The current mechanism that maintains the scavenge roots in nmethods list is unsuitable for CMS. The list implies that there are two types of collections: young (after which the list should be pruned) and full (during which we would scan the whole code cache). So, currently CMS doesn't prune this list at all, which means that the list can grow pretty big. For CMS we should actually maintain two lists: one that contains nmethods that point to the young gen and the other one that contains pointers to the old gen. Hopefully the seconds list would be smaller than the whole set of nmethods.