Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old October 11th, 2005, 03:45 AM
yanchun.yang@gmail.com
Guest
 
Posts: n/a
Default Is there any method to supervise the memory's waste?

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, 03:56 AM
yanchun.yang@gmail.com
Guest
 
Posts: n/a
Default 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, 04:55 AM
wavelet
Guest
 
Posts: n/a
Default 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, 05:26 AM
Axter
Guest
 
Posts: n/a
Default 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, 07:55 PM
Shezan Baig
Guest
 
Posts: n/a
Default 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-

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.