OpenJDK

interpreting jstack output

天涯浪子 提交于 2019-12-06 01:06:51
I have a java process loading a lot of data from a bunch of .csv files into a Neo4j database using the BatchInserter . I was using: OpenJDK 7 Ubuntu 12.04 Neo4j 2.0 M3 After loading the first 164 GB (according to ls -lh ) the folder size stopped increasing but the process kept running, no memory was released, and CPU was still at 100% (all according to htop ). The loading process is single threaded, only the JVM is using more than 1 thread - I guess by the ParallelGC . I'm not sure how to diagnose this type of problem but was instructed to try jstack , so have included its output below. Anyone

What happened to JEP 145 (faster jvm startup due to compiled code reusage)?

亡梦爱人 提交于 2019-12-06 00:52:19
问题 In 2012, a JEP 145 has been created in order to cache compiled native code in java for faster jvm startups . At that time, it had been officially announced. However, the JEP 145 does not exist anymore. What happened to it? The idea sounds great. I could not find an official statement why and when this project has been cancelled. 回答1: The text of the JEP is still available in the JEP source repository: http://hg.openjdk.java.net/jep/jeps/raw-file/c915dfb4117d/jep-145.md There doesn't seem to

Eclipse won't open in Linux Mint and Java won't open in different directories

喜夏-厌秋 提交于 2019-12-05 22:03:14
I had Installed Eclipse in /opt/eclipse in Linux Mint 18.2 cinnamon with openjdk-9 (please don't tell me switch over oracle jdk). Whenever I click on Eclipse icon this window shows up: Here is the content of that window: JVM terminated. Exit code=1 /usr/bin/java -Dosgi.requiredJavaVersion=1.8 -Dosgi.instance.area.default=@user.home/eclipse-workspace -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m --add-modules=ALL-SYSTEM -jar /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -os linux -ws gtk -arch

OpenJDK implementation of System.arraycopy

↘锁芯ラ 提交于 2019-12-05 20:25:43
问题 Following a question related to the way the JVM implements creation of Strings based on char[], I have mentioned that no iteration takes place when the char[] gets copied to the interior of the new string, since System.arraycopy gets called eventually, which copies the desired memory using a function such as memcpy at a native, implementation-dependent level (the original question). I wanted to check that for myself, so I downloaded the Openjdk 7 source code and started browsing it. I found

对Java Stack的一次探索

余生长醉 提交于 2019-12-05 20:19:01
问题说明 昨天发现线上有一些业务逻辑没有执行到,但是代码入口代码日志已经打印,深入下去一看,底层库里有一个事件执行的方法在每次执行时都会 new 一个 thread,在以往量不大时没有问题,量大时就可能导致线程创建不出来,报OOM错误(由于有同事在我看这个时重启了服务导致 gc 日志被清空和栈信息丢失,这个原因只是一个猜测)。 由此让我好奇几个问题 Java 最多可以创建多少线程? Java 控制线程大小选项 -Xss 的具体含义是什么? Java 的选项 -Xmx -Xms 控制堆的选项对线程创建有无影响? Java 的线程具体是怎么实现的? 探索 其实这几个问题是相互交错的,在查询过程中很多答案对这几个问题都有涉及,因此下面很多链接并不仅仅是针对某一个问题,更是一个一般的描述。 Java 虚拟机运行于 Linux服务器上,因此第一个问题和第四个问题可以合在一起看。Java 线程直接map的 OS 的 native thread[^1] [^2], 因此Linux 对线程的限制也就限制了 Java 可以创建的线程。Linux 对系统能创建的总的线程数和每个用户能够创建的线程数都是有限制的。 操作系统总的的限制可以看 /proc/sys/kernel/pid_max 值[^4], /proc/sys/kernel/threads-max [^5] 值, /proc/sys/vm

Fedora OpenJDK Set JAVA_HOME

一笑奈何 提交于 2019-12-05 20:14:24
I am using Fedora(actually Pidora since I am trying to set up hadoop on a cluster of raspberrypi). I installed oopenjdk on all of the nodes using ansible. However, when I tried to set up the JAVA_HOME environment variable, I got really confused looking at the folder of /usr/lib/jvm : [root@datafireball1 jvm]# ls java-1.7.0-openjdk-1.7.0.60-2.4.7.0.fc20.arm jre jre-1.7.0 jre-1.7.0-openjdk jre-1.7.0-openjdk-1.7.0.60-2.4.7.0.fc20.arm jre-openjdk [root@datafireball1 jvm]# ls -alth total 80K drwxr-xr-x 3 root root 4.0K Jun 7 21:07 . lrwxrwxrwx 1 root root 35 Jun 7 21:07 jre-1.7.0-openjdk -> /etc

编译jdk

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 19:10:22
原始参照 http://www.eclipse.org/openj9/oj9_build.html 第一步:先改造好Dockerfile 再 docker build -t openj9 -f Dockerfile . 注意其中的两个下载文件尤其是gcc编译器的情况,最好下载到本地再改造Dockerfile 第二步:进入容器的时候使用下面这种方法做宿主文件夹到容器内的映射,保证能随时更新代码 docker run -it -v /Users/k4n5ha0/hack/openj9/openj9-openjdk-jdk8:/root/openj9-openjdk-jdk8 openj9 注意以后进入这个容器都必须使用 docker start openj9 && docker exec -it openj9 /bin/bash 第三步:按照文档中正常的情况进行编译并调试 来源: https://my.oschina.net/9199771/blog/3134191

Can anyone interpret this C++ code (from OpenJDK6) into plain English?

拈花ヽ惹草 提交于 2019-12-05 16:51:12
Here's a code snippet from OpenJDK6's hotspot/src/share/vm/prims/unsafe.cpp (starting on line 1082): // JSR166 ------------------------------------------------------------------ UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) UnsafeWrapper("Unsafe_CompareAndSwapObject"); oop x = JNIHandles::resolve(x_h); oop e = JNIHandles::resolve(e_h); oop p = JNIHandles::resolve(obj); HeapWord* addr = (HeapWord *)index_oop_from_field_offset_long(p, offset); if (UseCompressedOops) { update_barrier_set_pre((narrowOop*)addr,

Oracle官网下载Java的api离线文档(新版方法)

痴心易碎 提交于 2019-12-05 14:45:22
前面转载的离线文档blog失效https://my.oschina.net/weiweiqiao/blog/731981 目前openjdk没有见到离线api文档,下载oracle文档。 1)进入链接https://www.oracle.com/technetwork/java/javase/downloads/index.html 2)选择如下图: 3)滚动条向下拉: 4)如图,选择即可。 来源: https://my.oschina.net/weiweiqiao/blog/3133547