代码之家  ›  专栏  ›  技术社区  ›  tresf

使用SCCM将Java应用程序作为系统运行时出错

  •  0
  • tresf  · 技术社区  · 3 年前

    SYSTEM 使用SCCM配置文件。所有Java调用如下所示:

    java -jar -Xms512m -Djna.nosys=true myapp.jar [options] ...
    
    • 当这个应用程序作为一个标准用户运行时,它工作得很好。

    调试此应用程序时,我们发现引发了以下错误:

    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.
    

    this Harvard article ,但我又犯了一个新错误。

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

    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
    

    系统

    0 回复  |  直到 3 年前
        1
  •  0
  •   tresf    3 年前

    -Xms512m 修复了SCCM的问题。幸运的是,安装程序不需要像请求的那样多的内存。