in my demo project,
69.741: [Full GC (Allocation Failure) 1023M->1023M(1024M), 1.1631632 secs]
about 30+ times, then throw OOM, about 1min.
the same jvm params, the same code. in my online project(has zk, nacos,es,rabbit,actuator...) about 5min+ then throw OOM
i want fast fail,can free memory fast, so what`s problem in my online project. what can i do?
i also try change java version(jdk-11.0.13 and 1.8.0_301), it`s the same result
the same jvm param
java -server -Xmx1024m -Xms1024m -Dapp.key=rrr -Dspring.profiles.active=docker -DskipTests -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Duser.timezone=GMT+8 -Djava.net.preferIPv6Addresses=false -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -Xloggc:./gcdemo.log -XX:+PrintHeapAtGC -Ddubbo.registry.address=*.* -jar ./demo3-0.0.1-SNAPSHOT.jar
the same code is
public Object ttttttsss() {
List s = new LinkedList();
while (true) {
String uuid = UUID.randomUUID().
toString();
uuid = uuid + uuid + uuid + uuid;
s.add(uuid);
}
}