gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 21 forks source link

Memory leak?? #36

Open GZYangKui opened 5 years ago

GZYangKui commented 5 years ago

There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (mmap) failed to map 1224736768 bytes for committing reserved memory. Possible reasons: The system is out of physical RAM or swap space The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap Possible solutions: Reduce memory load on the system Increase physical memory or swap space Check if swap backing store is full Decrease Java heap size (-Xmx/-Xms) Decrease number of Java threads Decrease Java thread stack sizes (-Xss) Set larger code cache with -XX:ReservedCodeCacheSize= JVM is running with Zero Based Compressed Oops mode in which the Java heap is placed in the first 32GB address space. The Java Heap base address is the maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress to set the Java Heap base and to place the Java Heap above 32GB virtual address. This output file may be truncated or incomplete.

Out of Memory Error (os_linux.cpp:2718), pid=31780, tid=31788

JRE version: OpenJDK Runtime Environment (11.0.3+7) (build 11.0.3+7) Java VM: OpenJDK 64-Bit Server VM (11.0.3+7, mixed mode, tiered, jvmci, compressed oops, g1 gc, linux-amd64) Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/yangkui/work/client-samples/Gradle/HelloFXML/build/client/linux-x86_64/gvm/core.31780)

--------------- S U M M A R Y ------------

Command Line: -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler -Dtruffle.TrustAllTruffleRuntimeProviders=true -Dsubstratevm.IgnoreGraalVersionCheck=true -Djava.lang.invoke.stringConcat=BC_SB -Xss10m -Xms1g -Xmx13441813704 -Duser.country=US -Duser.language=en -Dgraalvm.version=20.0.0-ea+12 -Dsvm.platform=org.graalvm.nativeimage.impl.InternalPlatform$LINUX_JNI_AMD64 -Dorg.graalvm.version=20.0.0-ea+12 -Dcom.oracle.graalvm.isaot=true --add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED --add-opens=jdk.unsupported/sun.reflect=ALL-UNNAMED --add-opens=java.base/jdk.internal.logger=ALL-UNNAMED --add-opens=java.base/jdk.internal.module=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED --module-path=/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/jvmci/graal-sdk.jar:/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/truffle/truffle-api.jar --upgrade-module-path=/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/jvmci/graal.jar com.oracle.svm.hosted.NativeImageGeneratorRunner -imagecp /home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/jvmci/graal-sdk.jar:/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/jvmci/graal.jar:/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/svm/builder/svm.jar:/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/svm/builder/objectfile.jar:/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/svm/builder/pointsto.jar:/home/yangkui/work/client-samples/Gradle/HelloFXML/build/classes/java/main:/home/yangkui/work/client-samples/Gradle/HelloFXML/build/resources/main:/home/yangkui/.gluon/omega/javafxStaticSdk/13-ea+7/linux-sdk/lib/javafx.base.jar:/home/yangkui/.gluon/omega/javafxStaticSdk/13-ea+7/linux-sdk/lib/javafx.fxml.jar:/home/yangkui/.gluon/omega/javafxStaticSdk/13-ea+7/linux-sdk/lib/javafx.controls.jar:/home/yangkui/.gluon/omega/javafxStaticSdk/13-ea+7/linux-sdk/lib/javafx.graphics.jar -H:CLibraryPath=/home/yangkui/.gluon/omega/graalLibs/20.0.0-ea+12/bundle/lib/svm/clibraries/linux-amd64 -H:Class=hellofx.HelloFXML -H:+ReportExceptionStackTraces -H:ReflectionConfigurationFiles=/home/yangkui/work/client-samples/Gradle/HelloFXML/build/client/linux-x86_64/gvm/reflectionconfig-linux.json -H:JNIConfigurationFiles=/home/yangkui/work/client-samples/Gradle/HelloFXML/build/client/linux-x86_64/gvm/jniconfig-linux.json -H:TempDirectory=/home/yangkui/work/client-samples/Gradle/HelloFXML/build/client/linux-x86_64/gvm/tmp -H:IncludeResources=./.frag$ -H:IncludeResources=./.fxml$ -H:IncludeResources=./.css$ -H:IncludeResources=./.gls$ -H:IncludeResources=./.ttf$ -H:IncludeResources=./.png$ -H:IncludeResources=./.jpg$ -H:IncludeResources=./.jpeg$ -H:IncludeResources=./.gif$ -H:IncludeResources=./.bmp$ -H:IncludeResources=./.license$ -H:IncludeResources=./.json$ -H:IncludeResources=.frag$ -H:IncludeResources=.fxml$ -H:IncludeResources=.css$ -H:IncludeResources=.gls$ -H:IncludeResources=.ttf$ -H:IncludeResources=.png$ -H:IncludeResources=.jpg$ -H:IncludeResources=.jpeg$ -H:IncludeResources=.gif$ -H:IncludeResources=.bmp$ -H:IncludeResources=.license$ -H:IncludeResources=.json$ -H:Name=HelloFXML -H:+ReportUnsupportedElementsAtRuntime -H:+AddAllCharsets -H:+ExitAfterWrite -H:+AllowIncompleteClasspath -H:EnableURLProtocols=http,https -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com.sun.javafx.tk.quantum.QuantumMessagesBundle,hellofx.hello

Host: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 4 cores, 11G, Manjaro Linux Time: Fri Jul 5 10:24:46 2019 CST elapsed time: 61 seconds (0d 0h 1m 1s)

dvdfmiller commented 4 years ago

I too thought I had a memory leak as when I ran nativeCompile it just gobbled up all my memory and swap file and crashed with " insufficient memory for the Java Runtime Environment to continue".

I started off with 8Gb memory with an Ubuntu 18.0.4 guest VM (virtualbox) but it turned out I just didn't have enough memory. In the end using Ubuntu 18.0.4 guest VM my nativeCompile worked with:

ps I inserted into gradle.properties: org.gradle.jvmargs=-Xms1024m -Xmx2048m but didn't make any difference with or without