简体   繁体   中英

Error running Java application as SYSTEM using SCCM

I'm attempting to run a Desktop installer using Microsoft's SCCM. The installer was written using NSIS which predominantly executes Java calls. This works great unless it's run as the SYSTEM profile using SCCM. All Java calls look like this:

java -jar -Xms512m -Djna.nosys=true myapp.jar [options] ...
  • ✅ When this application is run as a standard user, it works just fine.
  • ⛔️ When this application is run as SYSTEM, it does not work.

Debugging this application we've found the following error is thrown:

Error occurred during initialization of VM
Unable to allocate 60928KB bitmaps for parallel garbage collection for the requested 1949696KB heap.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I've tried using the recommendations from this Harvard article , but then I get a new error.

java -jar -Xms512m -Djna.nosys=true -XX:+UseSerialGC -XX:ActiveProcessorCount=1 myapp.jar
#                                   ^--- NEW         ^--- NEW

The new error:

Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpException in thread "main" ot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=245760Kb used=3192Kb max_used=3192Kb free=242567Kb
 bounds [0x00000295494c0000, 0x00000295497e0000, 0x00000295584c0000]
 total_blobs=1238 nmethods=897 adapters=254
 compilation: disabled (not enough contiguous free space left)
java.lang.OutOfMemoryError: Metaspace

Why won't Java run properly as SYSTEM using SCCM?

As a (non comprehensive) stop-gap solution, removing -Xms512m fixes the issue with SCCM. Fortunately the installer doesn't require as much memory as requested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM