【发布时间】:2013-08-09 00:52:17
【问题描述】:
我做了一个测试,基于activemq-cpp库的示例解决方案。
在测试中,我将 50,000 条消息发送到一个队列,在它们全部发送后我使用它们,INDIVIDUAL_ACKNOWLEDGE 在会话上,message->acknowledge() 在每条消费消息上。消费者是异步的。
发送消息前 java.exe 的内存(私有工作集):209,320 KB。发送所有消息后:412,548 KB。 消耗所有消息后:434,637 KB。意思是,虽然队列大小为 0,但内存没有被释放。 我错过了什么? 谢谢。
【问题讨论】:
-
来自stackoverflow.com/questions/16649601/… :
JVM acquires memory when it needs to execute some complex logic. When java is done processing the tasks the JVM will still keep that memory as a reserved space and is not released back to the OS. This architecture helps in performance because JMV does not have to request the same memory again from the underlying OS. It will still be within the range you define in -Xmx JVM parameter.- 即,这种行为是正常的。 -
这是有道理的。谢谢。
标签: activemq activemq-cpp