首页
Search
1
v2ray异常错误之二
3,310 阅读
2
linux时区设置
2,698 阅读
3
DB2常用操作
2,173 阅读
4
websphere修改jvm内存xmx和xms
1,929 阅读
5
nfs客户端文件属主为nobody的现象
1,552 阅读
技术
生活
运动
游戏
电影
登录
Search
标签搜索
docker
linux
troubleshooting
nginx
secure
truenas
mysql
windows
python
esxi
docker swarm
oracle
zabbix
tomcat
blog
dsm
群晖
rpa
freenas
db
yuc
累计撰写
291
篇文章
累计收到
0
条评论
首页
栏目
技术
生活
运动
游戏
电影
页面
搜索到
2
篇与
的结果
2024-05-31
模拟java内存泄漏OutOfMemoryError
如何模拟OOM 先上代码: import java.util.ArrayList; import java.util.List; public class MemoryOverflowTest { public static void main(String[] args) { List<int[]> list = new ArrayList<>(); try { while (true) { // 每次分配一个较大的数组 int[] array = new int[1000000]; list.add(array); System.out.println("Allocated: " + (list.size() * 1000000) + " ints"); } } catch (OutOfMemoryError e) { System.err.println("OutOfMemoryError caught!"); e.printStackTrace(); } } } 保存的文件名需要和 class 一致,也就是文件名应该为: MemoryOverflowTest.java 接着使用 javac 编译成 class: javac MemoryOverflowTest.java 现在就可以运行了,但是为了防止本机出现问题,建议运行的时候加上 Xmx 和 Xms 限制内存使用: java -server -Xmx64m -Xms64m MemoryOverflowTest
2024年05月31日
5 阅读
0 评论
0 点赞
2023-03-28
websphere修改jvm内存xmx和xms
查找配置文件路径(类似路径): /IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/22Node01Cell/nodes/node01/servers/server1/server.xml 类似配置(搜索HeapSize): <jvmEntries xmi:id="JavaVirtualMachine_1173423453121" verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false" initialHeapSize="512" maximumHeapSize="2048" runHProf="false" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments="-Djava.awt.headless=true" disableJIT="false"/>
2023年03月28日
1,929 阅读
0 评论
0 点赞