Jump to content

How to fix Java memory leak in client or script?


Elysiano

Recommended Posts

Hello everyone,

 

Recently I bought a small VPS to splash some accounts to higher magic. Its an VPS with 2GB Ram, so should be enough for at least two clients, right?

The problem is, that it stacks up memory usage overtime. When I start the bot it uses 600MB RAM, but 4 hours later it is at 1.4GB RAM usage. Then it quits with the error message: "OutOfMemoryError: Java heap space".

 

My question: How to fix this? Is this something client related or is it a fault in the script?

 

Hope someone can help me with this :) 

Link to comment
Share on other sites

2 hours ago, scape said:

Won't this prevent things like web walking from working since they require a large amount of memory?

Java by default reserves a large amount of memory for heap space. This only becomes an issue in environments where you are limited, so setting the max heap is actually a viable option in your case. 

Now heap space is underlined because there is also stack space, which you cannot control. So although you may set your max heap space to 1GB, java may use a bit more. 800MB max heap leaving 200MB for stack is probably a good estimate to keep the client at around 1GB. What you'll want to do is run one client with webwalking, wait probably 5 minutes then start the next client. If you don't wait, you will likely get an out of memory exception

If you can, don't use web walking and ensure that the script you are using is efficient. Large GUIs, fancy paints, all this kind of stuff will hinder your 2 client on 2 GB requirement. 

  • Like 1
Link to comment
Share on other sites

13 hours ago, Lemons said:

Try turning off sounds on the client, this is a known problem with VPS's without a sound server. You can also install a null sound server, but its easier just to mute the sounds ingame.

I disabled the sounds and ran the bot overnight for 12 hours. When I came back the bot was still running perfectly at 700MB :) The sound was indeed the problem, so thank you very much!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...