-Xms Question for long (French) week end

July 10, 2009

Hi all,

Before leaving in a 4 days week end (July 14th is Bastille Day ;o)) I would like to like to get your inputs regarding -Xms Sun JVM’s option.

This week I tried to find the best way to manage memory usage of our Eclipse’s based product. This work led me to ask my self How should I manage OutOfMemoryErrors and also bring me to -Xmx and to the mysterious (to my blinded eyes) -Xms option.

In our product we are setting -Xmx to 512m. All is clear and works perfectly with this option.

Regarding -Xms things are more complicate (once again, to my blinded eyes).

Sun “Tuning Garbage Collection” document says: “If the value of -Xms is smaller than the value of the -Xmx parameter, not all of the space that is reserved is immediately committed to the virtual machine”

I am wondering :

  • What “is immediately committed” exactly means ? Does it concern other running applications to the system ?
  • What’s the best value for -Xms is order to increase product performances and in order to not decrease other system applications performances ?
  • Is there any drawback to set this -Xms option to the same value than -Xmx ?? I am not a system expert at all, but it seems that setting this -Xms option to an high value doesn’t affect other running applications …
  • Is there any Virtual memory management relationship there ?

I would appreciate any Java expert comment on that topic in order to have a clear view of what this -Xms option really do and to use it.

Thanks in advance and have a nice week end.

Manu


How do you handle OutOfMemoryError ??

July 6, 2009

Sometimes, depending on a lot of circumstances, Eclipse user can face the famous OutOfMemoryError. Unfortunately our users sometime face this error.

Eclipse default handling for such errors prompts the user as following:

Out Of Memory handling

Out Of Memory handling

I am asking myself: is there any more useful information we can provide to the end user in order to prevent such errors to occur again ???

May be I can parse the Error message to check if it’s a heap or permanent generation out of memory ? Thus I will be able to tell the user: add the following option when launching the product.

It also appears that sometimes this dialog is not opened, and the error is only logged in the .log file. Does it depends on the thread throwing the error …

Do you handle these errors differently than Eclipse in you custom products ? If yes, how ?

I would be interested in any comments suggestions on that topic.

Manu