0

We have an embedded system which has lynx OS as the underlying Operating system upon which we have a virtual machine installed which runs java programs. Now i need to capture the process running and memory utilization of the base OS as well need a tracing system to keep track of the multithreaded application running on the virtual machine. I need to send the data captured to a remote server. Please give some suggestions about achieving this scenario.

Mr.Green
  • 274
  • 1
  • 3
  • 15

1 Answers1

0

In respect to the jvm part of your question:

Each java program would normally run on its own jvm process, you should therefore monitor them independently. To monitor memory usage in any jvm you basically need to monitor garbage collection statistics. To achieve this you need to add the following command line arguments on the command line:

-XX:+PrintGCDetails

This will output information of garbage collection.

-XX:+PrintGCTimeStamps

This will include time stamps in the garbage collection output.

You also might want to redirect the gc output to a file using:

-Xloggc:file

Where file is the file where gc output will be logged. You could then transmit and process this file in order to extract useful information concerning your program's behaviour. Based on that information you may tune your application in respect to memory usage.

If you need to monitor the jvm process for short periods of time (i.e. for problem investigation and resolution) then another option is attaching a profiler such as NetBeans. This will provide you much more information than the gc output, however this option can only be used for short periods of time since profilers degrade the performance of the jvm process.

Now regarding the OS and system level statistics, i'n not a LynxOS expert, however i have used a couple of popular tools such as ganglia and nagios in linux systems which do an excellent job in gathering statistics. I'm not certain however if they can be used on the LynxOS.

Lefteris Laskaridis
  • 2,292
  • 2
  • 24
  • 38
  • Thank you lefty!. Can you please throw some light on how can i transfer the data to a remote server? Whether i must use RMI or is there any other mechanism?. – Mr.Green Sep 28 '12 at 10:22
  • What you need to do is transfer the gc output log to some remote location. There are some options here: You could write a shell script that transfers the file in some way (i.e. via ftp) at a scheduled interval or you could place the gc output file in a directory which is remotely accessible if possible. – Lefteris Laskaridis Sep 28 '12 at 10:41
  • "To achieve this you need to add the following command line arguments on the command line: -XX:+PrintGCDetails" But i'm looking for a java app or logging framework to do this?. Is that possible as i don't know how i can place commands to the underlying OS through command prompt. We might not be able to open the command prompt as everything is packed in an embedded system. Need your suggestion on this. – Mr.Green Sep 28 '12 at 12:38
  • I guess that eventually *something* must invoke the java command line to start the jvm process. How is your application started on the OS? – Lefteris Laskaridis Sep 28 '12 at 12:57
  • Ok i see, so you are running your app on some kind of container. Which container do you use to deploy you apps on the server? Is it a web container like Tomcat or something else? – Lefteris Laskaridis Sep 28 '12 at 14:06