Memory Accounting, JDKs [was: Re: [Techtalk] Java on Linux]

Aaron Mulder ammulder at alumni.princeton.edu
Thu Jan 10 18:33:01 EST 2002


	When running with "native threads" (one process per thread), you 
get this effect.  All the processes representing threads in the same VM 
report the same memory numbers, I think.  So if you were able to get 
processes from all 3 JVMs showing in "top", you should see only 3 distinct 
memory numbers (though each repeated across several processes).
	It should be fairly easy to record the process number of the 
initial java process as each VM is launched (there's a shell variable, 
like $! or something), and there has got to be some way to show a 
process's ID and parent process ID through top or ps or something if you 
really want to track them all down.  But I don't know how to do that 
without spending some time communing with man pages.

Aaron

On Thu, 10 Jan 2002, Nicole Zimmerman wrote:
> I have a related question and some background that you all might be able
> to address.
> 
> My company develops a distributed security monitoring system in Java. The
> "head" of the distributed "tree" is a linux box running both the
> head-specific 'server' code and the common tree 'client' code. It can also
> run the GUI code (used to monitor the system) although it will not be
> shipped this way (the GUI code can be run anywhere that can connect to
> the 'server'/'head').
> 
> When I run the client and the server both on the same machine (for
> internal testing), along with the GUI, I am up to 241M memory used, 118
> Java 'processes' (according to ps). This seems like a lot, but we want to
> track down whether it is the client code or the server code that is doing
> the busywork with memory.
> 
> Using ps, I can get the RSS and the VSZ of the java processes, but that
> doesn't really look correct -- each of them say 200+M, which is impossible
> since I only have 256M RAM. So there is some shared memory going on, which
> I don't really care about. What I want is a way to find out how much
> memory each of the 3 JVM incarnations (client, server, GUI) is taking up
> individually. I will also include how much memory they have 'reserved'
> (including shared memory) which appears to be what I'm getting now. Any
> ideas? 
> 
> Also, I am wondering if the memory usage/number of spawned
> threads/processes would drop if we were to use IBM or Sun's JDK over
> Blackdown. The main reason we're using Blackdown is because we use debian
> and blackdown provides apt-getable binaries. Any thoughts here?
> 
> -nicole
> 
> At 09:56 on Jan 10, Aaron Mulder combined all the right letters to say:
> 
> > 	Well, I can't speak for FreeBSD, but I do Java development on
> > Linux for work, so I can at least help get up and running there.  
> > (According to Google, a FreeBSD JDK is available via "ports", and a native
> > JDK may be included in the forthcoming FreeBSD 4.5)
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://www.linuxchix.org/mailman/listinfo/techtalk
> 





More information about the Techtalk mailing list