Connecting Tech Pros Worldwide Help | Site Map

Is there any method to supervise the memory's waste?

  #1  
Old October 11th, 2005, 04:45 AM
yanchun.yang@gmail.com
Guest
 
Posts: n/a
I wrote a large code, but it spends memory very quick. Is there any
method to supervise memory's use and watch whether there is some waste?

  #2  
Old October 11th, 2005, 04:56 AM
yanchun.yang@gmail.com
Guest
 
Posts: n/a

re: Is there any method to supervise the memory's waste?


I forget to say that I always use new and delete to create and delete
some matrix

  #3  
Old October 11th, 2005, 05:55 AM
wavelet
Guest
 
Posts: n/a

re: Is there any method to supervise the memory's waste?


In windows,system tool can helps.
In unix, some Solaris has a a number of tools.
Firstly, "pmap" gives you a nice breakdown of the process' memory usage.
If you're on x86 you can probably compile Valgrind for solaris: that's
pretty much the golden standard. If you're on Sparc then I suggest the
open source Dmalloc library. Electric fence is an oldie but a goodie,
and it's had leak detection bolted on.

Above anwser from Jacques.

<yanchun.yang@gmail.com> wrote in message
news:1129002080.168587.319260@g14g2000cwa.googlegr oups.com...[color=blue]
> I wrote a large code, but it spends memory very quick. Is there any
> method to supervise memory's use and watch whether there is some waste?
>[/color]


  #4  
Old October 11th, 2005, 06:26 AM
Axter
Guest
 
Posts: n/a

re: Is there any method to supervise the memory's waste?



yanchun.yang@gmail.com wrote:[color=blue]
> I wrote a large code, but it spends memory very quick. Is there any
> method to supervise memory's use and watch whether there is some waste?[/color]

Check out the following code for portable method to tracking memory.
http://code.axter.com/debugalloc.h
http://code.axter.com/debugalloc.cpp

  #5  
Old October 13th, 2005, 08:55 PM
Shezan Baig
Guest
 
Posts: n/a

re: Is there any method to supervise the memory's waste?


yanchun.yang@gmail.com wrote:[color=blue]
> I wrote a large code, but it spends memory very quick. Is there any
> method to supervise memory's use and watch whether there is some waste?[/color]

It's much easier to not use 'new' and 'delete' than to find where the
leaks come from. Try using vector, it takes care of memory for you.

Hope this helps,
-shez-

Closed Thread