user710818
user710818

Reputation: 24248

How to find maximum allowed MaxPermSize for Eclipse?

I see that on my computer free near 1 GB, so I try set near

-XX:MaxPermSize=800m

but Eclipse doesn't start. When set:

-XX:MaxPermSize=380m

starts.

Which memory size is optimal? How can I calculate? Thanks.

Upvotes: 2

Views: 3901

Answers (3)

z12345
z12345

Reputation: 2216

if you set the initial heap size (-Xms) and the maximum heap size (-Xmx) to the same value this will ensure that there is enough memory available for the process, because it will start off at its maximum value. Then if you gradually decrease this value from 1G, you should be able to get it down to a point where the process will start. As long as the other processes running on the machine are typical, this should work to find the optimal heap size.

Upvotes: 1

Zoltán Ujhelyi
Zoltán Ujhelyi

Reputation: 13858

I don't know of a theoretial maximum memory size for the JVM. However, when considering the memory size, multiple kinds of memory shall be present in the memory (see http://www.yourkit.com/docs/kb/sizes.jsp and http://mark.koli.ch/2009/01/understanding-javas-perm-gen-maxpermsize-heap-space-etc.html for some ideas).

Basically, heap size is used for all runtime variables; permsize is used for loaded classes. In typical scenarios, permsize does not need to be 800M. The largest permgen size I set was about 256M.

However, I would suggest checking the logs: there are some boot logs in the folder of Eclipse (don't know the exact location); or you could start eclipse from the command line (use eclipsec.exe on Windows) or simply execute the eclipse binary from bash. This way you would get some feedback that might help what is wrong.

Upvotes: 1

user1145202
user1145202

Reputation: 147

I think that if you set MaxPermSize to 800m then you must increase the total memory with the -Xmx parameter.

Upvotes: 3

Related Questions