Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JVM 1.8 Min and Max Heap Sizes

Status
Not open for further replies.

SamBones

Programmer
Aug 8, 2002
3,186
US
I have an app that I'm running in a version 1.8 JVM in Windows. I'm setting max and min heap size, but it only seems to actually use the max setting. The min memory allocation is much lower than what I specified and it grows as needed.

My memory settings are...

Code:
-Xms10240m -Xmx10240m

That's 10 GB for both (it's a big app). It does top out at 10 GB (plus perm gen, etc), but it starts out only being about 1 GB. I want it to pre-allocate everything.

Is this a version 1.8 thing? I've searched all of the JVM/JDK/JRE docs for 1.8 and nothing indicates that it would be acting the way it is.

Any ideas?

 
I'm not an expert on this, but I remember something about the difference between reserving and allocating memory space. HOw are you measuring it? Is there a performance problem or just a need of control?

Cheers,
Dian
 
The app has very high memory demands. I want to make sure it gets all the memory it needs on startup and doesn't have to fight for it later if the machine is congested.

Plus, it should just work as advertised and it's not. That bugs me.

 
I'm mostly concerned with the process size. That's just normal process monitoring. With older versions of the JVM, the -Xms parameter would give the starting size of the heap. The VM would start up getting all of the memory in -Xms, plus some overhead for perm gen, thread stacks, and other small things. With version 8, it seems to be completely ignoring -Xms and doing what it wants.

In addition to Task Manager, I've also opened up the port to look in with JConsole, JMap, and a few other tools that came in the JDK.

 
Well, PermGen is gone and I suspect that the Xms is actually being taken into account, but the memory managament has changed and it's not reflected in usual tools. Maybe this helps.

Anyway, do you have any performance issues or it's just that you don't see the memory reserved?

Cheers,
Dian
 
Kind of both.

I'm doing some tuning on this app and historically setting min and max heap to the same value shaves a small amount of time off each garbage collection because the collector doesn't have to make any decisions on whether it needs to extend/expand or not. Older JVMs on slower processors, it was a noticeable time savings on larger JVMs.

So, when tuning the app, my first setting to put in is setting min same as max. I don't know if it will make a difference because it doesn't seem to be working. So I came on here (plus a great deal of Googling) to see if this is an expected behavior.

I knew Perm gen was gone and after reading how that part is being handled, it looks like a GREAT improvement.

The other link you provided contains stuff I've already done. In fact that's how I confirmed I wasn't getting the min I was asking for.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top