JDK-8186483 : [AOT] jaotc cannot be executed with NMT option
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2017-08-19
  • Updated: 2021-08-01
  • Resolved: 2017-08-22
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
I execute the following command trying to observe the native memory usage of jaotc:
"jaotc -J-XX:NativeMemoryTracking=summary --compile-commands java.base-list.txt --output libjava.base-non-tiered.so --module java.base"

Among them, "java.base-list.txt" is the same as the JEP-295 described for jaotc compiling java.base.

But it appears "OpenJDK 64-Bit Server VM warning: Native Memory Tracking did not setup properly, using wrong launcher?"

Is this a bug or just i use this incorrectly? Thanks!


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Note that this will be fixed in 18 with the upcoming JDK-8256844 "Make NMT late-initializable".
01-08-2021

Yes, it is limitation of NMT. It requires using 'java' launcher which checks specified flag NativeMemoryTracking values before starting JVM: https://bugs.openjdk.java.net/browse/JDK-8042469 AOT compiler 'jaotc' does not have such functionality and we don't have plans to implement it. Note, 'jaotc' is Java based tool and it uses Java heap memory and not native memory. It can be tracked by running it with --verbose flag which prints used java heap after each phase. I am closing this bug as Will Not Fix.
22-08-2017