+ Reply to Thread
Results 1 to 6 of 6

Thread: max heap size limit 247MB?

  1. #1
    Senior Member
    Join Date
    Feb 2011
    Posts
    266
    Thanks
    81
    Thanked 1 Time in 1 Post

    max heap size limit 247MB?

    Hello, Teresa,

    Is there a limit on max heap size? It seems no matter what we set in the admin console (512MB for example), when the ES5 starts it shows using xxMB out of 247MB.
    Our game with many users easily uses all 247MB soon after the server starts, and the server response becomes incredibly slow.
    Is there any way to address this problem? (increase max heap size, clean up memory so it's not always 247 out of 247, etc.).

    Thanks.
    Jesse

  2. #2
    Former Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,701
    Thanks
    84
    Thanked 1,178 Times in 1,165 Posts
    How are you starting ES5? For example, if you are using safemode then the value in ES Admin is ignored, and there's a different way that the max heap size is specified.
    Teresa Carrigan
    Senior Software Developer
    Janus Research Group, Inc.
    previously
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Senior Member
    Join Date
    Feb 2011
    Posts
    266
    Thanks
    81
    Thanked 1 Time in 1 Post
    Teresa,
    We are starting ES5 normally (with the start script from command), not in safemode.
    Regards,
    Jesse

  4. #4
    Former Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,701
    Thanks
    84
    Thanked 1,178 Times in 1,165 Posts
    I think I'll need to see your start script, and also perhaps a screen shot of the ES Admin general settings screen, showing both the heap size specified and the command line parameters specified.

    Also, after making the changes in general settings, and restarting ES5, do you still see those same settings displayed? And does your ElectroServer5.log file say 247 Mb on the memory size after the restart?
    Teresa Carrigan
    Senior Software Developer
    Janus Research Group, Inc.
    previously
    Senior Engineer
    Electrotank, Inc.

  5. #5
    Senior Member
    Join Date
    Feb 2011
    Posts
    266
    Thanks
    81
    Thanked 1 Time in 1 Post
    Sorry Teresa,
    We made some changes to our game and I can't reproduce this problem now. My admin console shows 45MB out of 494MB now when I set max heap size to 512MB. I will come back to this thread with screenshots if the problem shows up again.
    So is there a limit on how large we can set the max heap size? Is it the physical memory size?
    Thanks.
    Jesse

  6. #6
    Former Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,701
    Thanks
    84
    Thanked 1,178 Times in 1,165 Posts
    If you try to set the max heap size larger than is available on the operating system when ES5 starts, Java will refuse to start. A plain vanilla ES5 with few users needs more memory during startup than it does afterward, but a lot of applications keep a large amount of data in memory so it's difficult to give you advice on how much your application needs.

    There is also a max heap size that Java will allow, regardless of how much the operating system has, but I'm not sure how much that is. I've heard of ES5 applications that set the max heap size to 12 Gigs and it worked. My limited googling showed an example of 256g which would not work.

    This article says that the hard limit of a 32 bit JVM is 4 gigs on the heap size but is often lower. A 64 bit JVM can use a much larger heap size.

    If you specify a max heap size of 512 Mb, what ES5 will report as available will be lower but close. For example, an ES5 that sets max heap to 256 Mb will probably see "Memory used (MB out of 247)". I'm not sure why there is a difference but it might be due to the fact that Runtime.getRuntime().maxMemory() returns the number of bytes instead of number of MB, but I assume it has something to do with humans thinking an M is 1000 and computers thinking it is 1024.

    I wonder if when you reported the heap size not changing whether the ES5 was not restarted after making the change, or possibly the change not persisted correctly. Glad to hear it is working now.
    Last edited by tcarr; 02-14-2012 at 07:02 PM.
    Teresa Carrigan
    Senior Software Developer
    Janus Research Group, Inc.
    previously
    Senior Engineer
    Electrotank, Inc.

  7. The Following User Says Thank You to tcarr For This Useful Post:

    chengen (02-14-2012)

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts