0

存在堆空间有限和并发请求耗尽堆的问题。检查 maxmemory 并在 Spring Controller 级别返回带有适当错误消息的请求是一个好主意/编程实践吗?

4

1 回答 1

0

用纯java

Runtime runtime = Runtime.getRuntime();
//used memory
 runtime.totalMemory() - runtime.freeMemory()
//free memory
 runtime.freeMemory();
//available memory
 runtime.totalMemory();
//Maximum available memory
 runtime.maxMemory();
于 2013-10-17T19:54:29.913 回答