Posts Tagged ‘memory’

Custom SiteScope Memory Monitor – Part 1

In certain environments, a custom memory monitor may be required to monitor Unix based hosts.  Why? A Unix System Admin might describe it as follows:

Unix/Linux will fill any free memory with disk buffers and caching, but that should not be counted as “used” memory, because if an application needs it, the kernel will give it up. The proper way to calculate memory usage is to pull the total used and subtract whatever amount of cache and buffers are being used.

echo 'free | grep - | awk '{ print $4 }''/'free | grep Mem |awk '{print $2 }'' *100 | bc -l

On the SiteScope host, create a 'CustomMemoryMonitor.sh' file in /SiteScope_Root/remote.script/ directory. This can be done using Notepad.

Insert the script above into your .sh file and save it.

In the SiteScope interface, create a Script Monitor directed at your Unix host with the following settings:

  • Script: USE COMMAND
  • Match expressions: /[0-9]{2}.[0-9]{2}/
  • Remote script Command File: (select your .sh file from dropdown)

From here you can adjust the Thresholds to Alert on the Status of the monitor (which is a 0-100 percentage of the actual Free Memory available).

Enjoy!

See Also: Custom Memory Monitor Part 2

Debugging .hprof files using the Memory Analyzer Tool

If a SiteScope GUI becomes completely blank, or is otherwise unavailable, one of the culprits may be a lack of available disk space – on account of SiteScope creating a number of large JVM debugging files (.hprof files).  Over 35GB’s worth is not out of the question, and this can clearly tank an application as a result.  Essentially, these files are memory dumps that indicate a problem with the application configuration.

To open and parse these files, use the Eclipse Memory Analyzer Tool (MAT).
Download the zip file and extract its contents into the same SiteScope directory where javaw.exe lives:  C:\SiteScope\java\bin

From here on you are on your own, but the basic gist of it goes like this:

  • Open the MAT .exe file, which is located in the same directory you extracted the zip into.
  • Import/Open the SiteScope .hprof files, which are located in SiteScope bin folder: C:\SiteScope\bin
  • …And run all of the canned analysis reports against the .hprof files as you wish

Unless you are a Java Developer, the memory analyzer will not be terribly useful to you.
However, MAT will automatically zip up every Report you generate – which is a perfect format to forward to HP Support, along with the raw .hprof files themselves.  The zipped Reports should end up in the SiteScope\Bin directory after being created.

As a final note, the MAT *should* work against any other HP BTO product that produces .hprof files, such as BSM, however I have not tested this and would only do so after performing a full file system/db backup.

Enjoy!

Return top