300 sfs.current()->print_on_error(st, buf, buflen, verbose); |
300 sfs.current()->print_on_error(st, buf, buflen, verbose); |
301 st->cr(); |
301 st->cr(); |
302 } |
302 } |
303 } |
303 } |
304 #endif // ZERO |
304 #endif // ZERO |
|
305 } |
|
306 |
|
307 static void print_oom_reasons(outputStream* st) { |
|
308 st->print_cr("# Possible reasons:"); |
|
309 st->print_cr("# The system is out of physical RAM or swap space"); |
|
310 if (UseCompressedOops) { |
|
311 st->print_cr("# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap"); |
|
312 } |
|
313 if (LogBytesPerWord == 2) { |
|
314 st->print_cr("# In 32 bit mode, the process size limit was hit"); |
|
315 } |
|
316 st->print_cr("# Possible solutions:"); |
|
317 st->print_cr("# Reduce memory load on the system"); |
|
318 st->print_cr("# Increase physical memory or swap space"); |
|
319 st->print_cr("# Check if swap backing store is full"); |
|
320 if (LogBytesPerWord == 2) { |
|
321 st->print_cr("# Use 64 bit Java on a 64 bit OS"); |
|
322 } |
|
323 st->print_cr("# Decrease Java heap size (-Xmx/-Xms)"); |
|
324 st->print_cr("# Decrease number of Java threads"); |
|
325 st->print_cr("# Decrease Java thread stack sizes (-Xss)"); |
|
326 st->print_cr("# Set larger code cache with -XX:ReservedCodeCacheSize="); |
|
327 if (UseCompressedOops) { |
|
328 switch (Universe::narrow_oop_mode()) { |
|
329 case Universe::UnscaledNarrowOop: |
|
330 st->print_cr("# JVM is running with Unscaled Compressed Oops mode in which the Java heap is"); |
|
331 st->print_cr("# placed in the first 4GB address space. The Java Heap base address is the"); |
|
332 st->print_cr("# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress"); |
|
333 st->print_cr("# to set the Java Heap base and to place the Java Heap above 4GB virtual address."); |
|
334 break; |
|
335 case Universe::ZeroBasedNarrowOop: |
|
336 st->print_cr("# JVM is running with Zero Based Compressed Oops mode in which the Java heap is"); |
|
337 st->print_cr("# placed in the first 32GB address space. The Java Heap base address is the"); |
|
338 st->print_cr("# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress"); |
|
339 st->print_cr("# to set the Java Heap base and to place the Java Heap above 32GB virtual address."); |
|
340 break; |
|
341 default: |
|
342 break; |
|
343 } |
|
344 } |
|
345 st->print_cr("# This output file may be truncated or incomplete."); |
305 } |
346 } |
306 |
347 |
307 // This is the main function to report a fatal error. Only one thread can |
348 // This is the main function to report a fatal error. Only one thread can |
308 // call this function, so we don't need to worry about MT-safety. But it's |
349 // call this function, so we don't need to worry about MT-safety. But it's |
309 // possible that the error handler itself may crash or die on an internal |
350 // possible that the error handler itself may crash or die on an internal |
373 st->print("# "); |
414 st->print("# "); |
374 st->print_cr("%s", _message); |
415 st->print_cr("%s", _message); |
375 } |
416 } |
376 // In error file give some solutions |
417 // In error file give some solutions |
377 if (_verbose) { |
418 if (_verbose) { |
378 st->print_cr("# Possible reasons:"); |
419 print_oom_reasons(st); |
379 st->print_cr("# The system is out of physical RAM or swap space"); |
|
380 st->print_cr("# In 32 bit mode, the process size limit was hit"); |
|
381 st->print_cr("# Possible solutions:"); |
|
382 st->print_cr("# Reduce memory load on the system"); |
|
383 st->print_cr("# Increase physical memory or swap space"); |
|
384 st->print_cr("# Check if swap backing store is full"); |
|
385 st->print_cr("# Use 64 bit Java on a 64 bit OS"); |
|
386 st->print_cr("# Decrease Java heap size (-Xmx/-Xms)"); |
|
387 st->print_cr("# Decrease number of Java threads"); |
|
388 st->print_cr("# Decrease Java thread stack sizes (-Xss)"); |
|
389 st->print_cr("# Set larger code cache with -XX:ReservedCodeCacheSize="); |
|
390 st->print_cr("# This output file may be truncated or incomplete."); |
|
391 } else { |
420 } else { |
392 return; // that's enough for the screen |
421 return; // that's enough for the screen |
393 } |
422 } |
394 break; |
423 break; |
395 case INTERNAL_ERROR: |
424 case INTERNAL_ERROR: |