This is a discussion on what does 'top' actually show ? within the comp.unix.solaris forums, part of the Solaris Operating System category; --> Hello All, A simple test app allocates and releases memory in an endless loop. 'top' shows that application acquires ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello All, A simple test app allocates and releases memory in an endless loop. 'top' shows that application acquires memory, but never releases it. It looks like certain amount of memory is reserved by the application. How should 'top' memory readings be interpreted? Thanks, Alona |
| |||
| On Mon, 12 May 2008 09:28:27 -0700, Alona wrote: > A simple test app allocates and releases memory in an endless loop. > 'top' shows that application acquires memory, but never releases it. It > looks like certain amount of memory is reserved by the application. What does 'prstat -a' tell you about memory usage? > How should 'top' memory readings be interpreted? With toilet paper. |
| ||||
| Alona wrote: > Hello All, > > A simple test app allocates and releases memory in an endless loop. > 'top' shows that application acquires memory, but never releases it. > It looks like certain amount of memory is reserved by the > application. > > How should 'top' memory readings be interpreted? > > Thanks, > Alona The numbers are probably correct. Most dynamic memory is taken from the heap, and a certain amount of that is reserved by the app when it starts. When an app requests memory, if there isn't enough in the heap the malloc (or whatever) library will request more from the OS, growing the heap. When the app "free"s memory, it is restored to the heap but not back to the OS pool. So when your app requests memory you may see the amount of used memory increase in the top output. When your app frees memory, it still is held by the app, and top doesn't see the memory use decrease. -Wayne |