[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sweep Swap?




Hi,

  I have disabled Java after finding that it has BAD memory leaks
somewhere. What is happening is, your compilation leaks so much memory
that by the time it finishes the swap space is full. Normally this can be
done away with by trying to stop swapping on a certain partition from time
to time (try father-and-son in crontab every 10 minutes). BTW, having swap
space on the same disk does not speed up things. Try to have it evenly
distributed over all the disks you have. If this does not help, sorry. 
Note that if the swap partitions are large enough and there is more than
one then the command swapoff this_partition should NEVER fail. If it does,
you have a VERY bad problem. 

BTW, the kernel will not clean up leaked memory from the swap space until 
there is no more swap space left. This is correct as cleaning costs time. 
This is at least what I grasped from hacking the sources of 2.0.27.

Also, the kernel takes care that a reasonable amount of free ram (not 
virtual) is always free for processes to use (about 128k normally, try 
top or cat /proc/meminfo with a reasnoably loaded machine that is swapping).

hope this helps,

Peter Lorand Peres
------------------
plp@actcom.co.il 100310.2360 on CIS (please use Internet address for mail)

" The creed of Inland Revenue is simple: 'If we can bring one little smile
to one little face today - then somebody's screwed up somewhere' - David
Frost (Note: The above stands valid in all countries until proven wrong)

On Sun, 28 Sep 1997, Stas Bekman wrote:

> Hi,
> 
> Recently I have encountered a strange thing with my Linux swap mechanism
> 
> I have 32M RAM, 16M swap partition (2.0.30 kernel, pentium 200 MMX)
> I have started to use javac and it eats a lot of memory, so I added a 16M 
> swap file. 
> 
> Now , when I run X , Netscape and a few applications I get to 32M RAM, 
> and my swap starts working. When I start javac/java I get 16-20M more 
> memory taken and it's all swap! So here comes the problem 
> I have finished to compile Java and don't use it. But my swap usage is 
> still almost the same size. and when I run additional applications
> I feel the way I felt when I have had 8M RAM -- It's Crazy
> 
> Why, Swap isn't get cleaned up. As I remember from my OS course, kernel
> must use the prime memory first and put all the unused segments of code 
> into the swap or clean it up.
> 
> The only way to clean it was Reentering X. 
> Do I miss some point? I'm starting to think to buy some more memory, but 
> my average memory usage is under 32M.
> 
> Any ideas?
> Thanks
> 
> ----
> 
> BTW, from the IRA's Linux Announce Digests reposting get the smartbar tk
> script.  Nice tool (Mount/unmount cdrom/floppy, explorer, sw/hw info
> (interrupts) other admin tools in one click) give a try. I liked it
> www.geocities.com/SiliconValley/Pines/4123
> 
> ______________________________________________________________________
> Stas Bekman     mailto:sbekman@iil.intel.com.il [WebMaster Intel Corp]
> Address:        Aba Silver 12/29, Haifa, 32694, Israel  
> Phones:         [w]  972-(0)4-865-5188, [h]  972-(0)4-828-2264/3020
> Home Page:      http://techunix.technion.ac.il/~ofelix     
> Resource Center http://www.eprotect.com/stas/TULARC (Java,CGI,PC,Linux)
> Linux-il Home:  http://www.linux.org.il/		        
> 
> 
> 
> 
>