Skip to content

Commit c850d73

Browse files
committed
添加了关于BTrace的FAQ
1 parent 8be1b3f commit c850d73

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

java/basic/java-basic.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ System.out.println(s5 == s6); // true
255255
- [StackOverflow : What is String interning?](https://stackoverflow.com/questions/10578984/what-is-string-interning)
256256
- [深入解析 String#intern](https://tech.meituan.com/in_depth_understanding_string_intern.html)
257257

258+
在 jdk6中StringTable是固定的,就是1009的长度,所以如果常量池中的字符串过多就会导致效率下降很快。在jdk7中,StringTable的长度可以通过一个参数指定:
259+
260+
-XX:StringTableSize=99991
261+
258262
## new String("abc")
259263

260264
使用这种方式一共会创建两个字符串对象(前提是 String Pool 中还没有 "abc" 字符串对象)。

tool/btrace.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### FAQ
2+
1. btrace DEBUG: adding to boot classpath failed!
3+
常见是由于系统安装的btrace版本和代码中引入的jar的版本不匹配,建议加载jar(/btrace/../build/)
4+
2. Port 2020 unavailable.
5+
2020端口不可用,那就换一个:btrace pid -p port xxx.java

0 commit comments

Comments
 (0)