Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently installed Debian 6.0.6. Here are the machine's states:

  • CPU - AMD XP 3000+
  • RAM - 1 Gig
  • HDD - IDE 80 Gig

I primarily use this machine for developing toy personal projects. When I run NetBeans, I sometimes get a low memory error. Running top shows that, sure enough, RAM is at almost 100% usage. However, swap space usage is at 0. Does this mean that the swap partition that I created during installation is not enabled. I assumed that after creating the swap partition the installation process would automatically enable it. What do I need to do to enable swapping?

share|improve this question
1  
Is your swap partition listed in your /etc/fstab ? Also, what does swapon -s return ? –  don_crissti Oct 20 '12 at 18:23
    
@don_crissti I'm not on that machine ATM, so I'll get back to you on those questions when I have a chance to check. I do recall that top showed the amount of swap space available as expected. –  Code-Guru Oct 20 '12 at 18:36
2  
@Code-Guru The java JVM has a maximum heap space size, which could be what you are actually hitting. -Xms and -Xmx settings adjust this. –  jordanm Oct 21 '12 at 1:48
1  
@jordanm I would say - right on mark. Make it an answer (and explain the differences between java and os memory)... –  Nils Oct 21 '12 at 20:11
    
@jordanm I wondered if I might be running into Java-related memory issues. I found this FAQ explaining how to set the heap size in NetBeans. I'll have to try it out later. And feel free to add an answer with more details. You'll certainly get at least an upvote from me, and most likely I'll accept as well. –  Code-Guru Oct 21 '12 at 23:26

1 Answer 1

"Does this mean the swap partition that I created during installation is not enabled?": If you look at the stats on swap in top, it gives not only the amount in current use, but also the total amount available on the system, and the amount remaining. If all three of these numbers are 0, then yes, your swap partition is probably not enabled.

"What do I need to do to enable swapping?": swapon <swapdevice or file> If that fails, you may need to use mkswap on it first. If you want it to be permanent, add it into /etc/fstab.

If you have swap, and it's not being used, then you're probably running out of java heap space rather than system memory. There are parameters you can pass to java to adjust the amount of memory it will allocate for various purposes. Consult the java documentation or search stackexchange for details on how to use them. Be aware though that while java may technically run while swapping in and out like mad, its performance may not be adequate. Consider a memory upgrade for the machine in question in that case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.