INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

JVM 1.8 Min and Max Heap Sizes

JVM 1.8 Min and Max Heap Sizes

(OP)
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?

RE: JVM 1.8 Min and Max Heap Sizes

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

RE: JVM 1.8 Min and Max Heap Sizes

(OP)
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.

RE: JVM 1.8 Min and Max Heap Sizes

How are you measuring memory comsumption?

Cheers,
Dian

RE: JVM 1.8 Min and Max Heap Sizes

(OP)
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.

RE: JVM 1.8 Min and Max Heap Sizes

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

RE: JVM 1.8 Min and Max Heap Sizes

(OP)
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.

RE: JVM 1.8 Min and Max Heap Sizes

So I guess you've already been into this

Cheers,
Dian

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close