Tuesday, November 20, 2007

Eclipse Europa (3.3) OutOfMemoryError: PermGen space

I like new Eclipse Europa (v.3.3). It has many advatages. It's faster and better and more... My colleague posted good review (Polish only) some time ago so I won't repeat. But there is one stinky thing about Eclipse when one try to work with bigger project... Eclipse Europa suddenly crashes without any error message. The cause: OutOfMemoryError. This damn thing kills all invention as you have to restart Eclipse to continue work. But even with that trick in a pocket one won't go far because it will happen soon again.

How to check whether it is memory error? Find workspace\.metadata directory and open .log file. Then jump to the end and look for stack trace with OutOfMemoryError: PermGen space. That's the cause.

I found many gurus who had very good ideas and theories about memory options that should be passed to greedy Eclipse but not many of them made any impression on Eclipse's memory hunger. So forget about eclipse.ini and it's content. Just modify your shortcut and set something about that

"C:\Program Files\eclipse3.3\eclipse.exe" -vmargs -Xms256m -Xmx952m -XX:MaxPermSize=256m

I run 2GB box at my work. As for weird 952 Megs for maximum memory size. It was chosen throught set of experiments. I found that there's a connection between each argument. If you change Xms param suddenly Xmx becomes invalid (and crashes Eclipse during startup). So do some experiments too with your start params.

My experience is that Eclipse 3.3 never goes beyond 500 Megs of physical memory and 500 Megs of virtual so maybe almost 1 Gig is too much but I never saw OutOfMemoryError again.

Sony Vaio Hotkey Utility problem

If you have Sony Vaio laptop you might have problems with running Hotkeys Utility. It simply doesn't work. After installation and rebooting combinations of Fn keys still don't work.

I downloaded Hotkeys Utility from Sony Vaio-link web site. It was dedicated for my vaio. I installed it and nothing. I dug the net and finally I found a short notice that there is other software that should be installed in proper order:

Sony Shared Library
Sony UI Library
Sony Hotkeys Utility

Due to legal issues I won't put these files here but there are plenty of pages with them. Just use google.

Install these programs and then install Hotkeys Utility program and the problem is solved.

If this helped you, please drop a line for me so I'll know that's worth of writing such articles.