comparison src/share/vm/compiler/compileBroker.cpp @ 2353:1c0cf339481b

7025742: Can not use CodeCache::unallocated_capacity() with fragmented CodeCache Summary: Use largest_free_block() instead of unallocated_capacity(). Reviewed-by: iveresov, never, ysr
author kvn
date Wed, 09 Mar 2011 09:15:16 -0800
parents 850b2295a494
children 1927db75dd85
comparison
equal deleted inserted replaced
2352:425688247f3d 2353:1c0cf339481b
1362 while (true) { 1362 while (true) {
1363 { 1363 {
1364 // We need this HandleMark to avoid leaking VM handles. 1364 // We need this HandleMark to avoid leaking VM handles.
1365 HandleMark hm(thread); 1365 HandleMark hm(thread);
1366 1366
1367 if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) { 1367 if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) {
1368 // the code cache is really full 1368 // the code cache is really full
1369 handle_full_code_cache(); 1369 handle_full_code_cache();
1370 } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) { 1370 } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) {
1371 // Attempt to start cleaning the code cache while there is still a little headroom 1371 // Attempt to start cleaning the code cache while there is still a little headroom
1372 NMethodSweeper::handle_full_code_cache(false); 1372 NMethodSweeper::handle_full_code_cache(false);
1643 void CompileBroker::handle_full_code_cache() { 1643 void CompileBroker::handle_full_code_cache() {
1644 UseInterpreter = true; 1644 UseInterpreter = true;
1645 if (UseCompiler || AlwaysCompileLoopMethods ) { 1645 if (UseCompiler || AlwaysCompileLoopMethods ) {
1646 if (xtty != NULL) { 1646 if (xtty != NULL) {
1647 xtty->begin_elem("code_cache_full"); 1647 xtty->begin_elem("code_cache_full");
1648 CodeCache::log_state(xtty);
1648 xtty->stamp(); 1649 xtty->stamp();
1649 xtty->end_elem(); 1650 xtty->end_elem();
1650 } 1651 }
1651 warning("CodeCache is full. Compiler has been disabled."); 1652 warning("CodeCache is full. Compiler has been disabled.");
1652 warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize="); 1653 warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
1654 CodeCache::print_bounds(tty);
1653 #ifndef PRODUCT 1655 #ifndef PRODUCT
1654 if (CompileTheWorld || ExitOnFullCodeCache) { 1656 if (CompileTheWorld || ExitOnFullCodeCache) {
1655 before_exit(JavaThread::current()); 1657 before_exit(JavaThread::current());
1656 exit_globals(); // will delete tty 1658 exit_globals(); // will delete tty
1657 vm_direct_exit(CompileTheWorld ? 0 : 1); 1659 vm_direct_exit(CompileTheWorld ? 0 : 1);