Jump to content

General RAM related questions


Guest crashuncle

Recommended Posts

Hello Mangos Community,

Since my RAM problems cause tons of crashes everyday (Which is a reason why I change now to a 64bit Linux instead of using my 32bit Windows) I would like to change some RAM settings.

1. Is it possible to limit Mangos or generally a application under Linux to use not more then X GB of RAM? (I want to limit it so 2 Testrealms don't disturb each other).

2. Is it possible to load all Maps on start in the Cache, to prevent long HDD loads (lags)? (I saw that at a other Core already but it didn't worked good)

3. What is the easiest way to read in Linux the RAM usage / how much RAM is free with Mangos. So it would be possible to show it for example with .info or something similiar? (I planned to force a crash when it use more then X GB of RAM or let it set Unload to 1 and reload the configs)

Thanks in advance for your help,

Crashuncle

Link to comment
Share on other sites

Hello Mangos Community,

Since my RAM problems cause tons of crashes everyday (Which is a reason why I change now to a 64bit Linux instead of using my 32bit Windows) I would like to change some RAM settings.

1. Is it possible to limit Mangos or generally a application under Linux to use not more then X GB of RAM? (I want to limit it so 2 Testrealms don't disturb each other).

2. Is it possible to load all Maps on start in the Cache, to prevent long HDD loads (lags)? (I saw that at a other Core already but it didn't worked good)

3. What is the easiest way to read in Linux the RAM usage / how much RAM is free with Mangos. So it would be possible to show it for example with .info or something similiar? (I planned to force a crash when it use more then X GB of RAM or let it set Unload to 1 and reload the configs)

Thanks in advance for your help,

Crashuncle

Things are pretty different than you might imagine, even lot of Linux kernel developers haven't much idea of how the memory management is handled in there and I'm not expert in it either, but know a few bits :)

1) You can limit number of players and so on, generally, it isn't a good idea to set a strict memory limit for a process, because after exceeding that limit, mmap() and other functions will return error and the whole process segfaults (in most cases, I really doubt MaNGOS has some protection for that), however you can set it with ulimit, see "ulimit -m".

2) Yes, it is .. and it's done that by default (MS Windows IIRC doesn't support this), on every read(). Cached files gets deleted whenever the memory is needed for some process. If you want to make a storage in ram, use ramdisk (pure kernel one or simple tmpfs, disadvantage for kernel ramdisk is that it's size can be set only at boot, tmpfs may, on the other hand, get swapped, but it's more easy to use).

3) "free" , "top", "cat /proc/meminfo", ...

The thing is that you don't want memory to be free. If you don't need all the space, you want the disk cache in it (which is a very nice feature in fact), so you might see something like "1G used, 80MB free, 6G cache", which is good in fact, you have ~6G of "free" memory (which can be used when needed).

Another pretty cool thing for running multiple almost identical servers is virtual memory page sharing, google/wiki for it if you want :)

PS: Google for keywords from /proc/sys/vm/

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use