jvm

The Java ZGC garbage collector USES a lot of memory

情到浓时终转凉″ 提交于 2020-12-30 17:17:49
问题 I built a simple application using Springboot.The ZGC garbage collector I use when deploying to a Linux server USES a lot of memory..I tried to limit the maximum heap memory to 500MB with Xmx500m, but the JAVA program still used more than 1GB. When I used the G1 collector, it only used 350MB.I don't know why, is this a BUG of JDK11?Or do I have a problem with my boot parameters? ####Runtime environment operating system : CentOS Linux release 7.8.2003 JDK version : jdk11 springboot version :

The Java ZGC garbage collector USES a lot of memory

雨燕双飞 提交于 2020-12-30 17:12:47
问题 I built a simple application using Springboot.The ZGC garbage collector I use when deploying to a Linux server USES a lot of memory..I tried to limit the maximum heap memory to 500MB with Xmx500m, but the JAVA program still used more than 1GB. When I used the G1 collector, it only used 350MB.I don't know why, is this a BUG of JDK11?Or do I have a problem with my boot parameters? ####Runtime environment operating system : CentOS Linux release 7.8.2003 JDK version : jdk11 springboot version :

Passing JAVA_OPTS to spring boot application through docker-compose

喜你入骨 提交于 2020-12-30 02:22:12
问题 I am creating a docker image using below configuration. Once image is ready i want to pass JAVA_OPTS to my docker container, so it can be passed to my spring boot application. Whenever i try to bring up the container i am getting "runtime create failed: container_linux.go:348: starting container process caused "exec: \"java $JAVA_OPTS\": executable file not found in $PATH": unknown" error. Am i missing something ? Any help is really appreciated Dockerfile FROM openjdk:8-jdk-alpine LABEL

Passing JAVA_OPTS to spring boot application through docker-compose

こ雲淡風輕ζ 提交于 2020-12-30 02:18:43
问题 I am creating a docker image using below configuration. Once image is ready i want to pass JAVA_OPTS to my docker container, so it can be passed to my spring boot application. Whenever i try to bring up the container i am getting "runtime create failed: container_linux.go:348: starting container process caused "exec: \"java $JAVA_OPTS\": executable file not found in $PATH": unknown" error. Am i missing something ? Any help is really appreciated Dockerfile FROM openjdk:8-jdk-alpine LABEL

Does object construction guarantee in practice that all threads see non-final fields initialized?

自闭症网瘾萝莉.ら 提交于 2020-12-29 04:00:55
问题 The Java memory model guarantees a happens-before relationship between an object's construction and finalizer: There is a happens-before edge from the end of a constructor of an object to the start of a finalizer (§12.6) for that object. As well as the constructor and the initialization of final fields: An object is considered to be completely initialized when its constructor finishes. A thread that can only see a reference to an object after that object has been completely initialized is

Does object construction guarantee in practice that all threads see non-final fields initialized?

眉间皱痕 提交于 2020-12-29 03:59:22
问题 The Java memory model guarantees a happens-before relationship between an object's construction and finalizer: There is a happens-before edge from the end of a constructor of an object to the start of a finalizer (§12.6) for that object. As well as the constructor and the initialization of final fields: An object is considered to be completely initialized when its constructor finishes. A thread that can only see a reference to an object after that object has been completely initialized is

Is there a lightweight method which adds a safepoint in Java 9+

妖精的绣舞 提交于 2020-12-28 13:44:21
问题 Is there a cheaper method call in Java 9+ which keeps its safepoint? The JVM removes safepoints at runtime to improve efficiency however this can make profiling and monitoring the code more difficult. For this reason, we deliberately add trivial calls in carefully selected places to ensure there is a safepoint present. public static void safepoint() { if (IS_JAVA_9_PLUS) Thread.holdsLock(""); // 100 ns on Java 11 else Compiler.enable(); // 5 ns on Java 8 } public static void optionalSafepoint

Is there a lightweight method which adds a safepoint in Java 9+

耗尽温柔 提交于 2020-12-28 13:44:19
问题 Is there a cheaper method call in Java 9+ which keeps its safepoint? The JVM removes safepoints at runtime to improve efficiency however this can make profiling and monitoring the code more difficult. For this reason, we deliberately add trivial calls in carefully selected places to ensure there is a safepoint present. public static void safepoint() { if (IS_JAVA_9_PLUS) Thread.holdsLock(""); // 100 ns on Java 11 else Compiler.enable(); // 5 ns on Java 8 } public static void optionalSafepoint

Is there a lightweight method which adds a safepoint in Java 9+

这一生的挚爱 提交于 2020-12-28 13:44:18
问题 Is there a cheaper method call in Java 9+ which keeps its safepoint? The JVM removes safepoints at runtime to improve efficiency however this can make profiling and monitoring the code more difficult. For this reason, we deliberately add trivial calls in carefully selected places to ensure there is a safepoint present. public static void safepoint() { if (IS_JAVA_9_PLUS) Thread.holdsLock(""); // 100 ns on Java 11 else Compiler.enable(); // 5 ns on Java 8 } public static void optionalSafepoint

How to distribute Java Application

蹲街弑〆低调 提交于 2020-12-28 07:50:48
问题 I would like to know about the various options for distributing a Java application. I know that you can Distribute the Source Code and let users compile it themselves, or provide make files, etc.. Package it into a JAR, and have self extracting archives and (I'm sure, myriad other ways) I'm hoping for some explanations about the most common options (and one's I haven't thought of) and in particular, do they require a user to have a JVM, or can it be bundled with one - personally I'm not too