Why does OSBot use more memory than XYZ Bot?
Most bots set a jvm argument indicating the max heap space, "-xmx". This usually limits the jvm from going over a certain amount of heap space. At OSBot, we don't set the max heap space, we let Java naturally allocate the resources that it wants to. How much memory the jvm naturally wants should not be an issue, unless you are running a serious bot farm - which I know for a fact that most botters aren't.
This matters because smaller heap space means that the jvm has to GC more and is usually more prone to memory exceptions. If you have 16GB of RAM, I'm sure you can spare 1-2GB unless you are farming. I set -mem in CLI but it uses more! Why?
-mem is a wrapper for -xmx, a stupid idea on my part. Remember, xmx indicates max heap space, and the stack space allocation is something you cannot set. So although you set your heap space for 512mb, your stack space will increase the total memory usage. This has absolutely nothing to do with the client or botting. What is the stack and heap? I don't understand!
Don't set -mem or -xmx if you are unfamiliar with these terms. You are playing around with settings that you probably shouldn't be. Once again, if you absolutely have a requirement to set max heap space, then do so.