java队列内存释放问题
java中的 Queue对象:commenQueue
while(commenQueue.size()!=10){
commenQueue.offer(obj)//10 个元素。
}
while(commenQueue.isEmpty()){
obj=commenQueue.poll()
//obj被处理
}
commenQueue的isEmpty()判断为true,
commenQueue原来持有的元素是否成为垃圾被收集。
commenQueue占有的内存空间会不断扩大吗