This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse 3.4 memory problems, freezing and crashing when editing JSP/JSFs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse 3.4 memory problems, freezing and crashing when editing JSP/JSFs" Watch "Eclipse 3.4 memory problems, freezing and crashing when editing JSP/JSFs" New topic
Author

Eclipse 3.4 memory problems, freezing and crashing when editing JSP/JSFs

Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
I've been using Eclipse for a while, and generally speaking it is OK. When running Eclipse, I allocate it 250mb in a VMWare image that has 1024mb in total. Eclipse does, however, have a couple of issues that cause me problems:
1) When editing JSPs or JSFs, memory usage slowly increases until is hits the 250mb limit.
2) Eclipse randomly freezes for 5 minutes or so (worse when editing JSPs), I see the virtual hard drive thrash.
Not long after this, Eclipse will freeze/crash

Has anyone got any advice on how to figure out what the problem is? I'm doing a lot of JSP/JSF (RichFaces) work just now and having to restart Eclipse every two hours is getting a bit ridiculous. Closing all open source tabs and requesting the garbage collector run does not solve the memory issue.

I am also running the application in debug mode via the Tomcat plugin, if that makes any difference.
I did have the IBM JBoss add-on, but removed it as it seemed to cause more problems.

Thanks!


SCJP6
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Looks like you are hitting heap space issues, the "hang" is probably a major garbage collection, and the subsequent sluggishness probably means that the heap is really low on memory and your are doing nothing but major collections. I suggest increasing the heap size for eclipse. Also, since you are working in a VM, you might want to set both min and max heap sizes the same. Something like this in eclipse.ini:

-Xms512m
-Xmx512m

JBoss In Action
Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
Thanks - I'll give it a try but I am sure I've had it set like that before and the same thing happens. The memory use just keeps rising until it maxes out and there is no way to free it up, but only when editing JSP/JSFs.

It's really annoying!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

In that case there is a memory leak somewhere. You can use tools like VisualVM or Eclipse MAT to track down such things.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

250MB for Eclipse? I'm surprised the thing even launches. I've got a 2GB system (non-VM) that often crashes due to lack of memory. Major projects where I'm doing debugging in an embedded Tomcat seem to demand 1GB+. The browser and email client eat up most of the rest of the system RAM. And unfortunately, this particular box can't hold additional RAM, so I have to keep an eye on it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Jason Irwin
Ranch Hand

Joined: Jun 09, 2009
Posts: 327
Cheers Peter. If there is a memory leak, it's in Eclipse itself (or a plug-in I am using). I had to install Galileo at home as Ganymede just totally died (no idea what happened, wouldn't even start). First thing I've noticed is that the memory footprint is about half of Ganymede (but I don't do JSP/JSF at home).

The host machine has 4gb (on 32-bit XP *sigh*), VMWare image 1gb, Eclipse assigned 250mb. Email ect stay on the host, the VMWare image is there purely to run Tomcat/JBoss/Whatever, Eclispe, TFS and a few other tools. Generally speaking though, Eclipse has been fine with 250mb.

Given what I've noticed at home, I might just wipe Eclipse in work and try Galileo; see if that's any better. Someone will need to test it for the environment upgrade anyway.
Hmm...and there's a thought; but one for a different thread.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Eclipse 3.4 memory problems, freezing and crashing when editing JSP/JSFs
 
Similar Threads
Hotmail 250MB free, 2 GIG Pay
J2EE classes, where are they?
Some problems with JSF
How to upgrade your hotmail account to 250MB!
WYSIWYG editor for JSPs.