Search code examples
javalog4jclient-serverrmilynxos

Mechanism to capture data from a remote server


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.


Solution

  • 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.