An application runs until the heap is exhausted of free memory, at which point the GC stops all application code, performs a garbage collect, and then lets the application continue.
应用程序一直运行,直至耗尽堆的可用内存,此时GC停止所有的应用程序代码、执行垃圾收集,然后让应用程序继续运行。
It's the long-lived objects, such as ones you might pool, that are expensive to garbage collect.
只 有那些生存周期很长的对象,才适合使用对象池技术,因为对它们进行垃圾回收的成本很高。
The code in Listing 4 shows how the Garbage Collect command is implemented.
清单4中的代码展示了Garbage Collect命令是如何实现的。
应用推荐