FreeBSD9.2: Tomcat process with very high memory allocation
vsjcfm at gmail.com
Tue Nov 26 10:56:32 UTC 2013
The best way to know this is looking at the top source code. :)
But even this will not show you what amount of memory process can eat
because it can call malloc() at any time and get more memory.
Of course, you can:
1. Use integrated limits similar to that in PHP, Java, if application
2. Calculate maximum memory usage if footprint is known. For example,
lzma-based archiver will allocate about 11*dictionary_size memory for
compression in worst case.
3. Set system limit in login.conf.
The second is preferred. If this impossible, you can use first (but
this can have negative effects).
Third is the worst way - it can crash the application. App says:
"Kernel, give me two additional megabytes of memory", and kernel will
respond: "I don't have any free memory" even if the actual free memory
amount is very large
2013/11/26, Matthias Petermann <matthias at petermann-it.de>:
> Hello Anton,
> On 11/25/2013 11:08 PM, Anton Sayetsky wrote:
>> There is _no_ problem. Tomcat has 9 GiB of virtual memory and 439 MiB
>> of resident.
>> The actual amount of really used mem is 439 MiB.
>> Virtual contains all memory that theoretically can be used (but NOT
>> allocated at a point of time in contrast of res) by process, all
>> shared libraries that it used etc etc. In practice, virt memory shows
>> nothing helpful.
>> You should take a look on only resident memory of processes in most
> Just for curiosity - is there a way to display all (theoretically) used
> virtual memory of a process? So I'd like to understand how it calculates
> the total size shown in top.
> Many thanks in advance.
> Best regards,
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions