Minecraft allocating way too much memory!

Discussion in 'Bukkit Help' started by zonedabone, May 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    zonedabone

    I guess this becomes a problem with all programs, but there's quite a bit of extra memory use acording to $top.

    Code:
    5891 minecraf  18   0  423m 326m 7104 S    3 31.9  12:23.82 java
     1423 minecraf  19   0  126m  22m 6080 S    0  2.2   0:03.31 java
    
    Is there some way to make minecraft not allocate all of the extraneous memory?
     
  2. Offline

    iPhysX

    what is the string you use to run your server?
     
  3. Offline

    bentheexo

    That looks like you have two minecraft servers running. Notice the major differences in process id (PID) also the variations in the memory allocations do not lead me to believe that those are the same server running but instead, two separate instances.

    Instead of posting top could you post the output of

    Code:
    ps aux | grep java
     
  4. Offline

    woodzy

    @zonedabone
    try this but add the nneded stuff four your OS
    java -D64 -XX:parallelGCThreads=3 -XX:+AggressiveOpts -Xshare:auto -Xshare:auto -jar craft.jar

    the -D64 is to force the use of a 64 bit system remove it if ur on a 32 bit OS
     
  5. Offline

    MonsieurApple

    This doesn't pertain to the thread.

    As benthexxo said, please give us the output of "ps aux | grep java". Thank you.
     
  6. Offline

    woodzy

    do you even know what this will do? it will let the OS controll the memory usage (OP's issue)
    so his server can run smoother and not eat up all his ram i use it everyday and with 0 users online it uses about 800MBram and on a full load of 25 users in at a meer 2.8GB ram with 1 GB to spare so what else you got?
     
  7. Offline

    zonedabone

    Oh! That secod process is probabl from rtoolit, though I'm concerned with why it's allocating so much for that, coniderig there's a flag to only give it 30 megs.

    Code:
    1000      1423  0.1  1.5 126672 16128 ?        Sl   14:56   0:00 java -Xmx30M -Xms30M -XX
    :MaxPermSize=40M -jar Minecraft_RKit.jar <myuser>:<mypassword>
    1000      1771  7.3 22.4 413964 235660 ?       Sl   14:56   0:15 java -Xms50M -Xmx250M -D
    jline.terminal=jline.UnsupportedTerminal -jar /home/minecraft/minecraft/current/craftbukk
    it.jar nogui
    root      2031  0.0  0.0   1772   548 ttyp0    S+   15:00   0:00 grep java
    Yeah. The extra process is remote toolkit, using way over its allocation of memory. Also, I only allocated minecraft a max of 250 megs. Now, know that craftbukkit allocates past this limit with plugins, but having so much extra is rediculous.
     
  8. Offline

    Phaedrus

    It's not craftbukkit going passed the limit, it's java. Why is it so low anyway? I would hardly call under 500megs "way too much memory"
     
  9. Offline

    resba

    I always recommend having a base 700MB for Craftbukkit Servers and adding 500MB per 10 people. It's bound to overflow.
     
  10. Offline

    zonedabone

    It works fine with the current usage. We're running on a low ram vps with plans to upgrade soon.
     
  11. Offline

    MonsieurApple

    I missed the part where he asked about not allocating the RAM. However, the correct parameter would be "-Xincgc" which is not what you suggested.
     
  12. Offline

    woodzy

    @MonsieurApple do you even run a server? he was useing to much ram not useing not enof. hate to be rude but F*****g READ! then post and come back and what i use is what some of the top notch server use thats were i got the info from you know the 100+ player servers out there
     
  13. Offline

    drdanick

    22m is within the range specified for the wrapper.
    326m is beyond what you specified for the server, but one must remember that java allocates memory to more than just one type of heap, and then also the stack.

    Also, make sure you are actually reading the values from the RES column, not the VIRT column in top. You should be more concerned with physical memory usage, rather than virtual.
     
  14. Offline

    AgentKid

    Okay. We get it. You are using a cool startup script that maximizes RAM usage. They're trying to get the basic information about how much RAM zone is using. Heck, I don't even think your startup script will work for him since he's using a wrapper, which we wouldn't have known if the other people hadn't asked.

    @zonedabone That memory usage that you're seeing is present no matter what. The server, while starting up, loads a 25x25 chunk zone around spawn into the RAM so that when the players connect, it just has to send it (rather than load then send, which would cause you to sit there falling for ~30 seconds). I'm surprised that you haven't run into any issues with running the server with 250MB cap. You should definitely get more RAM to avoid problems in the future.
     
  15. Offline

    kramark

    This does not compute. I need a parser to decipher this.
     
  16. Offline

    TnT

    Petty disagreements can go elsewhere.

    As for the suggestion to use -Xincgc, its worth a try, but it may not work on that low of a RAM value - I've had sporadic reports of it giving an error with less than 512M allocated. A 250 MB cap is pretty damn low too, it may work but as @AgentKid said, I'm surprised you haven't ran into other issues.
     
  17. Offline

    zonedabone

    Yes. THe 22mb is fine. THe problem is the extra 100mb that it's allocating but not using. What can I do about that?

    The problem is that the virtual memory usage is what my vps looks at. I can't allocate more memory if my virtual total is above what I can use. I need to find a way to reduce it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  18. Offline

    TnT

    My server reports usage of 3863M Virt, yet I only allocated 3GB. The thing is, its not actually taking up 3863M, its taking up 1 GB (RES value). The rest, I believe, is cached - but not actually used.

    In order to decrease that virt value, I think you'd need to lower that 250M value even more.
    EDIT: Try drdanick's advice below.
     
  19. Offline

    drdanick

    TnT likes this.
Thread Status:
Not open for further replies.

Share This Page