Published in:

Blog

·

· ·

Get max heap of jscape MFT server using GetMaximumHeapInMb function

·

This custom trigger function helps to get the maximum heap in MB on run time. This custom function helps to get the statistics during too many user uploads/downloads or during trigger execution. This custom function is used along with other custom function GetUsedHeapInMbwhere both can be compared during server slowness.

Downloads

Source code and build instructions

How to get the used heap using GetMaximumHeapInMb Function

Let me now show you how to implement that.

1. Create a Trigger to get the statistics of the Maximum Heap

Login into admin console of JSCAPE MFT Server > Triggers and Click Add to create a Trigger

Give the trigger aNameand then select theCurrent Timeevent type from the drop-down list.

max_heap_threshold_img1

ClickNextto Step 2 where a condition can be set to execute the trigger.

Consider an example that the Jscape Server is too busy (from 22 Hours to 23 Hours) in processing the tasks on a specific time in a day. The slowness of the server can be due to excess heap usage (one of the reason for slowness).

In order to debug and know about the heap statistics we need to get the heap usage. Hence in the expression add the condition to be as;

Hour=22 AND (Minute=0 OR Minute=15 OR Minute=30 OR Minute=45)

The above expression indicates that the used heap value should be logged from 22 Hours to 23 Hours scheduled with a interval of 15 minutes.

Once the condition is set ClickNextto proceed

used_heap_threshold_img2

The step 3 asks to add an action, Add the action “System Out” from drop down list, to print the statistics to the domain logs

Click OK to proceed

used_heap_threshold_img3

The Parameters for the action “System Out” is;

  • Message

As the name indicates, Messageis where you want the server to log.

For example as below;

Along with custom message use the GetMaximumHeapinMb function to log the maximum heap allocated. In order to use the function , Click the Functions button and select the GetMaximumHeapinMb function. If the function is not listed checkout whether the build (Source code and build instructions) is available

max_heap_threshold_img2

In order to print the used heap checkout the custom functionGetUsedHeapInMb

ClickOK to save the settings

That’s it. Now you know how to create a trigger to log the maximum heap of JSCAPE MFT Server.

Latest Articles