Runtime.getRuntime().totalMemory() 数值一直不断增加

本文讨论了一个具体的Java内存泄露场景:Runtime.getRuntime().totalMemory()数值持续增加的问题,这可能导致OutOfMemoryError异常并最终引发系统崩溃。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Runtime.getRuntime().totalMemory() 数值一直不断增加 ,迟早会oom,crash将出现


待续




2025-08-14T10:20:48.253+0800 WARN main Bootstrap http-server.authentication.allow-insecure-over-http 2025-08-14T10:20:48.253+0800 WARN main Bootstrap memory.heap-headroom-per-node 2025-08-14T10:20:48.253+0800 WARN main Bootstrap query.max-memory-per-node 2025-08-14T10:20:48.253+0800 WARN main Bootstrap query.max-total-memory-per-node 2025-08-14T10:20:48.253+0800 WARN main Bootstrap 2025-08-14T10:20:49.068+0800 ERROR main com.facebook.presto.server.PrestoServer Unable to create injector, see the following errors: 1) Error: Could not coerce value '8G' to DataSize (property 'memory.heap-headroom-per-node') in order to call [public NodeMemoryConfig NodeMemoryConfig.setHeapHeadroom(DataSize)] 2) Configuration property 'http-server.authentication.allow-insecure-over-http' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 3) Configuration property 'memory.heap-headroom-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 4) Configuration property 'query.max-memory-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 5) Configuration property 'query.max-total-memory-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 5 errors ====================== Full classname legend: ====================== Bootstrap: "com.facebook.airlift.bootstrap.Bootstrap" DataSize: "io.airlift.units.DataSize" NodeMemoryConfig: "com.facebook.presto.memory.NodeMemoryConfig" ======================== End of classname legend: ======================== com.google.inject.CreationException: Unable to create injector, see the following errors: 1) Error: Could not coerce value '8G' to DataSize (property 'memory.heap-headroom-per-node') in order to call [public NodeMemoryConfig NodeMemoryConfig.setHeapHeadroom(DataSize)] 2) Configuration property 'http-server.authentication.allow-insecure-over-http' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 3) Configuration property 'memory.heap-headroom-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 4) Configuration property 'query.max-memory-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 5) Configuration property 'query.max-total-memory-per-node' was not used at Bootstrap.lambda$initialize$2(Bootstrap.java:252) 5 errors ====================== Full classname legend: ====================== Bootstrap: "com.facebook.airlift.bootstrap.Bootstrap" DataSize: "io.airlift.units.DataSize" NodeMemoryConfig: "com.facebook.presto.memory.NodeMemoryConfig" ======================== End of classname legend: ======================== at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:576) at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:163) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) at com.google.inject.Guice.createInjector(Guice.java:87) at com.facebook.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:263) at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:155) at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:96)
最新发布
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值