cancel
Showing results for 
Search instead for 
Did you mean: 

Error when opening SAP Memory Analyzer on mac

Sidney
Product and Topic Expert
Product and Topic Expert

Hi all,

I am learning how to use SAP Memory Analyzer to analyze heap dump created by NetWeaver AS Java, when OutOfMemory error occurs.

But as I download SAP Memory Analyzer onto my macbook, I have this error:

The JVM shared library "/Library/Java/JavaVirtualMachines/sapmachine-jdk-18.jdk/Contents/Home/bin/../lib/server/libjvm.dylib"<br>does not contain the JNI_CreateJavaVM symbol.

In my JAVA_HOME I only have one jdk sapmachine-jdk-18.jdk, so does it mean that this jdk doesn't work for SAP Memory Analyzer?

How can I solve this? Can I install another version of jdk???

Sidney
Product and Topic Expert
Product and Topic Expert
0 Kudos

As I found out the recommended lowest version of jdk is 11, and I check mine:

% java --version

openjdk 18 2022-03-22

OpenJDK Runtime Environment SapMachine (build 18+36-sapmachine)

OpenJDK 64-Bit Server VM SapMachine (build 18+36-sapmachine, mixed mode)

Sidney
Product and Topic Expert
Product and Topic Expert
0 Kudos

My computer is macbook pro, M1, which means the cpu is arm-based, and I notice that the app is x86_64.

Although M1 is also 64bit, but is this the case?

View Entire Topic
Sidney
Product and Topic Expert
Product and Topic Expert

I solved it finally!!! After googling for a whole night and having tried at least 4 solutions!

I found that my eclipse.app are also Intel-based (x86_64) app and also using JVM, and it works fine. So I compare the Contents/info.plist of eclipse.app and mat.app and found they all not specify the version of jdk (because I have only one version of jdk, so they are all using it as the default one). So it must not be the jdk issue.

Then I found that mat.app is based on eclipse.app (although it is standalone instead of eclipse plug-in, which I also installed out of desparation). So I compared their Contents/Eclipse/eclipse.ini and Contents/Eclipse/MemoryAnalyzer.ini, and found one parameter occuring in eclipse but missing in mat:

-vm<br>/Users/i505432/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_17.0.2.v20220201-1208/jre/lib/libjli.dylib

So I copied it in the right place, and it works like a charm!!!

p.s. other possible causes/solutions I found (not in my case):

- if you have multiple jdk, you need to specify the -vm by changing the comment in mat.app/Contents/info.plist

- check the JAVA_HOME env parameter, and export it permanantly

- check cpu architecture, but it is fine as long as the app and cpu are all 64bit, because M1 can run intel and arm and apple silicon

- install eclipse plug-in editioned Memory Analyzer: in marketplace search memory analyzer (the problem is after I installed it I cannot find where to open it in eclipse, so haven't tried)

- open jdk put its libjvm.dylib differently than other jdk sources, `/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home/lib/server/libjvm.dylib` vs `/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home/jre/lib/jli/libjvm.dylib`