Hmm, I may have another explanation, and A. Khattri, I owe you an
apology.  I just noticed something interesting in my top output:

Swap:  2097144k total,    28192k used,  2068952k free,   687764k cached

  PID USER      PR  NI %MEM  VIRT  RES CODE DATA SWAP  SHR S %CPU   
TIME+  COMMAND
 3619 rjf       16   0  3.2  249m  32m 1468 210m 217m  19m S  0.0  
7:17.89 amarokapp

Notice that my swap used is only 28M, but amarokapp shows 217M of swap. 
Somebody is lying!!

My guess is that amarokapp uses mmap for accessing files, so they get
mapped into its virtual memory space.  But, since that 'memory' really
exists on the hard drive, that portion of the apps virtual memory shows
up as swap.

Jose, do you see the same effect?  If so, what files does your java
program open, does it use mmap, and are they particularly large?  You
can use something like 'strace -e open,mmap' to be sure.

-Richard


Richard Fish wrote:

>A. Khattri wrote:
>
>  
>
>>On Wed, 6 Apr 2005, Jose Gonzalez Gomez wrote:
>> 
>>
>>    
>>
>>>It seems Java takes 1,5Gb of memory!!! Am I right?
>>>   
>>>
>>>      
>>>
>Seems to be right.  Wow.  Even VMWare running XP on my system only
>consumes 350MB of memory!!
>
>  
>
>>Isn't that "virtual memory" ?
>>
>>The resident size is 80Mb no?
>> 
>>
>>    
>>
>
>Virtual memory = resident + swap.
>
>man top.
>
>-Richard
>
>
>  
>

--
gentoo-user@gentoo.org mailing list

Reply via email to