java GC name 'MarkSweepCompact'
what is MarkSweepCompa开发者_如何学Goct ?
It's a garbage collection algorithm. It's basic workings are described in Wikipedia.
The basic idea is that you perform one "marking" pass over all your objects you can access, marking them. Then you "sweep" over your heap, freeing the memory of those objects that can't be reached anymore (which are not marked). The "compact" pass then compacts memory again since you now have multiple unused holes in it which can make allocation of new objects more difficult or expensive.
精彩评论