Thứ Sáu, 7 tháng 4, 2017

Decrease server memory usage? page 1

Technofrood
12-18-2009, 07:48 PM
Is there any way to decrease the amount of ram used by the Linux server? I am trying to run a server on my VPS, it seems to be working apart from the fact it is using close to 300MB of RAM (on a windows server with the same config it only uses 70-130MB RAM) which is pushing me over my guaranteed limit of 512MB and into burstable. I have bots turned off.
lamster
12-18-2009, 07:57 PM
Unfortunately some Linux JVMs are huge memory hogs -- most of that memory is being used by the VM, not the actual game server process.

You can try a different VM (for reduced overhead) or reducing the memory available to the game server process.

Assuming install dir is ~/Altitude:
To change the VM that Altitude will use, edit ~/Altitude/.install4j/pref_jre.cfg
To fiddle with VM parameters:
Create a file ~/Altitude/server_launcher.vmoptions, and add VM options (one per line)
For example you could experiment with something like:
-Xmx96m
To reduce the game server's available memory from 128 MB (default) to 96 MB.
bmaker
12-18-2009, 08:12 PM
This might be useful, too:
http://java.sun.com/docs/hotspot/HotSpotFAQ.html#compiler_types

On servers the java VM runs in server mode per default. (Server mode prefers longterm performance to a smaller memory footprint. The client mode is the opposite. See the linked information above.)

So you could not only add -Xmx96m to the file "server_launcher.vmoptions", but also "-client".

Best regards, bmaker
combat
12-19-2009, 06:57 AM
Is there any way to decrease the amount of ram used by the Linux server? I am trying to run a server on my VPS, it seems to be working apart from the fact it is using close to 300MB of RAM (on a windows server with the same config it only uses 70-130MB RAM) which is pushing me over my guaranteed limit of 512MB and into burstable. I have bots turned off.

I know Linux is cool and free yadda yadaa etc etc.. But this is why it's so much easier to use a non-open source OS... You don't run into weird problems like an altitude server using up 300 mb of RAM.
bmaker
12-19-2009, 04:55 PM
Of course, operating systems differ a lot... but we have the same software here on windows as well as on linux. The memory usage should be nearly the same on both machines (assuming the configuration of the java virtual machines does not differ).

Altitude running 2 servers on windows 7 (32bit):
http://www.imagedose.de/13353/image/
Note: The windows taskmanager per default does not show the according column "Virtual size". I think this is also the reason for technofrood's wrong conclusion...

Altitude running the same config on linux (32bit):

USER VSZ RSS
altitude 321084 137036


127 mb (win7) vs. 137 mb (linux) and
367 mb (win7) vs. 321 mb (linux) look pretty much the same. ;)

Trust me: On servers linux is the most powerful operating system so far (whereas on desktops/personal computers windows is the most powerful operating system so far).

But actually I just wanted to show that the memory usage of altitude is nearly the same on windows and linux.
Karl
12-21-2009, 11:22 PM
jrockit might use less memory:
http://www.oracle.com/technology/software/products/jrockit/index.html

and to clarify the default java heap size is 128MB. So a server takes 128MB + JVM overhead. Like lamster said earlier try changing Java heap size by passing -Xmx96mb

Không có nhận xét nào:

Đăng nhận xét