Date: Tue, 26 Nov 2013 12:56:30 +0200 From: Anton Sayetsky <vsjcfm@gmail.com> To: Matthias Petermann <matthias@petermann-it.de> Cc: FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: FreeBSD9.2: Tomcat process with very high memory allocation Message-ID: <CAFG2KCKTK0extQycJk%2Bu%2BdW%2B2XQxC0_XvjZ-6MNfkUqc14=k=g@mail.gmail.com> In-Reply-To: <5293EB36.9000303@petermann-it.de> References: <5293C7F7.6040503@d2ux.org> <CAFG2KCLAN6D9mRjFsNzuA7sJaZb0oq2NKw5mPKbAznX5QxKpeA@mail.gmail.com> <5293EB36.9000303@petermann-it.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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 supports them. 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@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 >> cases. >> http://linuxpoison.blogspot.com/2009/10/what-is-difference-among-virt-res-and.html > > 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, > Matthias > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFG2KCKTK0extQycJk%2Bu%2BdW%2B2XQxC0_XvjZ-6MNfkUqc14=k=g>