Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Oak TarMK memory mapped files

Avatar

Level 4

Hi guys.

Lately I am trying to investigate Oak feature that exploits direct memory (off-heap memory) to increase performance [1] [2] [3]. As far as I have understood, besides memory assigned to AEM through JVM heap, Oak uses off-heap memory as well. In order to actually make use of this feature I have set the following JVM parameters:

/usr/java/jdk1.8.0_40/bin/java -server -Xms5120m -Xmx5120m -XX:MaxDirectMemorySize=5120m -XX:PermSize=512m -XX:MaxPermSize=512m

Total memory is 12 G, so the idea was: taking out 2 G from total (operative systems, etc...), 50% to AEM max heap (5 G), and the other 50% (5 G) free to be used, hopefully, by Oak through direct memory. I have also set this -XX:MaxDirectMemorySize=5120m to explicitely set max direct memory.

Now my doubt is: how can I be sure that those free 5 G of memory are really used by Oak? How can I monitor and trace this? How can I compare performances?

Java version 1.8

AEM 6.0 + SP3 running on Unix64 bit

OAK version is 1.0.22

Total memory is 12 G

[1] https://www.terrabeata.com/2015/03/think-outside-the-heap-with-aem-6-and-jackrabbit-oak-tarmk/

[2] http://www.pro-vision.de/content/dam/pro-vision/production/adaptto/2013/adaptto2013-oak-for-users-mi... (slide 17)

[3] http://www.slideshare.net/AEMHub2014/oak-michael-marth (slide 10)

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

This response was provided by Adobe TARMK experts:

The argument -XX:MaxDirectMemorySize=5120m does not work (in Windows at least), when I  tested it.  So it'll grab ALL of the free RAM.

http://jayan.kandathil.ca/CQ-OPS/memory-mapping.pn

 

In Windows, to track this, use Task Manager.  Subtract "Working Set" from "Private Working Set".  Also, (on Windows) use Microsoft TechNet Process Explorer to look at all of the file handles opened by the JVM process - there should be one handle per tar file in segmentstore:

https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx

​ 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

This response was provided by Adobe TARMK experts:

The argument -XX:MaxDirectMemorySize=5120m does not work (in Windows at least), when I  tested it.  So it'll grab ALL of the free RAM.

http://jayan.kandathil.ca/CQ-OPS/memory-mapping.pn

 

In Windows, to track this, use Task Manager.  Subtract "Working Set" from "Private Working Set".  Also, (on Windows) use Microsoft TechNet Process Explorer to look at all of the file handles opened by the JVM process - there should be one handle per tar file in segmentstore:

https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx

​ 

Avatar

Level 4

My issue is that NOT all the available memory outside the heap is used...

My case is total memory: 12 G.

Max heap 5 G.

Max direct memory 5 G (I am on unix system).

Max memory occupation reaches 8 G.

Is this expected?