From: Ara.T.Howard@... Date: 2005-04-27T13:14:35+09:00 Subject: Re: [ANN] ] MemoryProfile A memory usage profiling module. (was memory leak) On Wed, 27 Apr 2005, John Carter wrote: > On Wed, 27 Apr 2005, Joe Van Dyk wrote: > >> Got a memory leak in the following code.. not sure if DRb is necessary >> in it or not. > > Try > http://rubyforge.org/snippet/detail.php?type=snippet&id=70 > > It is really _very_ trivial to use. (it is also pretty brute force and > dumb code) > > Save to snippet as MemoryProfile.rb and then run your code as > > ruby -w -r MemoryProfile your_code.rb > > On exit it reports simple counts and also traverses the object tree to > give detailed counts of what object is using what and prints the > largest object as well. The log file is appended to /tmp/memory_profile.log > > It takes quite a lot of time and memory... > > It also dumps /proc/pid/status to display your vm usage, so it is a > little Linux specific, but you can cure that with a # or two. very cool. thanks for this. cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | although gold dust is precious, when it gets in your eyes, it obstructs | your vision. --hsi-tang ===============================================================================