jvm

How is it decided that how much physical memory is to be allocated to java heap?

对着背影说爱祢 提交于 2020-06-13 00:47:06
问题 I have machine with 16G RAM. I run a java application with arguments -Xms9G -Xmx9G . When I run top command I see that my java process is taking 13.8g VIRT , but only 4.6g of RES . PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5019 root 20 0 13.8g 4.7g 18m S 0.7 30.7 3:28.39 java On running pmap command, I see that only ~3.9g of heap is present as RES , rest 5.7g is in virtual . Address Kbytes RSS Dirty Mode Mapping 0000000580000000 9452384 4074228 4074228 rw--- [ anon ] Upon

When thread in Java is removed from memory? [duplicate]

你。 提交于 2020-06-09 18:18:59
问题 This question already has answers here : Java Thread Garbage collected or not (4 answers) Closed 5 years ago . From the Java API doc: The Java Virtual Machine continues to execute threads until following occurs: All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method. I hope my assumption is correct that once thread finishes its run() method it becomes eligible for garbage

How define class after byte code transofrmation with ASM (class file version 0.0)

纵然是瞬间 提交于 2020-06-08 14:02:54
问题 I cannot load a class after byte code modification with ASM library. Here it is identity transformer and I expect to get modified array with the same size as bytes one, but it 2 times shorter! (439 vs 278) String path = SimpleClass.class.getName().replace(".", "/") + ".class"; ClassLoader classLoader = SimpleClass.class.getClassLoader(); InputStream is = classLoader.getResourceAsStream(path); byte[] bytes = IOUtils.toByteArray(is); ClassReader reader = new ClassReader(bytes); ClassWriter

What java.security.egd option is for?

荒凉一梦 提交于 2020-06-07 09:21:50
问题 In a project I'm working on, the application is launched using a command similar to this: java -Djava.security.egd=file:/dev/urandom -jar app.jar I've never seen the java.security.egd option before. Searching a bit, it seems to be used to configure random number generation in a Java application. Is it right? When is it supposed to be applied? 回答1: Java applications can and should use java.security.SecureRandom class to produce cryptographically strong random values by using a

What java.security.egd option is for?

独自空忆成欢 提交于 2020-06-07 09:21:10
问题 In a project I'm working on, the application is launched using a command similar to this: java -Djava.security.egd=file:/dev/urandom -jar app.jar I've never seen the java.security.egd option before. Searching a bit, it seems to be used to configure random number generation in a Java application. Is it right? When is it supposed to be applied? 回答1: Java applications can and should use java.security.SecureRandom class to produce cryptographically strong random values by using a

Apache Spark - how to set timezone to UTC? currently defaulted to Zulu

笑着哭i 提交于 2020-06-07 06:08:23
问题 In Spark's WebUI (port 8080) and on the environment tab there is a setting of the below: user.timezone Zulu Do you know how/where I can override this to UTC? Env details: Spark 2.1.1 jre-1.8.0-openjdk.x86_64 no jdk EC2 Amazon Linux EDIT (someone answered the below then deleted): https://www.timeanddate.com/time/zones/z 回答1: Change your system timezone and check it I hope it will works 回答2: Now you can use: spark.conf.set("spark.sql.session.timeZone", "UTC") Since https://issues.apache.org

Suspending the JVM for a limited amount of time

ⅰ亾dé卋堺 提交于 2020-05-29 08:33:37
问题 How can I suspend the execution of a JVM for a configurable amount of time, similar to want happens on a full, serial, Garbage Collection? I want to test some edge cases but it's difficult to create the exact pauses I need with manually generating garbage + System.gc() . I'm trying to 'freeze' all the threads in the application, to simulate a situation where an application becomes unresponsive, and then resumes execution. The application is part of a cluster, and I'm trying to debug some

Suspending the JVM for a limited amount of time

橙三吉。 提交于 2020-05-29 08:32:10
问题 How can I suspend the execution of a JVM for a configurable amount of time, similar to want happens on a full, serial, Garbage Collection? I want to test some edge cases but it's difficult to create the exact pauses I need with manually generating garbage + System.gc() . I'm trying to 'freeze' all the threads in the application, to simulate a situation where an application becomes unresponsive, and then resumes execution. The application is part of a cluster, and I'm trying to debug some

What is remembered set in G1 algorithms used for?

安稳与你 提交于 2020-05-27 13:20:30
问题 I just read some blogs about G1 algorithm. The usage of remembered-set is confused to me. Here is what I think: Since we can use DFS to walk through every reference from GC-Roots, why do we need remembered-set? Cause all the blogs to say the reason why we use remembered-set is we don't need to check every region to see if there is an object that is referenced by GC-Roots 回答1: You need to understand what Card Table is first, IMO. How do you scan only young generation region and clean it, if

Maven surefire plugin crahsing jvm on java 11 (Corrupted STDOUT by directly writing to native stream in forked JVM 1)

大兔子大兔子 提交于 2020-05-27 11:51:09
问题 Running a maven build using java 11, the build issues the following warning whilerunning tests: [WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file /home/thomas/code/irdeto-control/fps-license-service/fps/target/surefire-reports/2019-04-11T14-05-32_318-jvmRun1.dumpstream ...followed by the following stderr output after the build fails: $ cat error.message [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire