Mon, 29 Apr 2013 16:13:57 -0400
8011773: Some tests on Interned String crashed JVM with OOM
Summary: Instead of terminating the VM, throw OutOfMemoryError exceptions.
Reviewed-by: coleenp, dholmes
minqi@4267 | 1 | <html> |
minqi@4267 | 2 | <head> |
minqi@4267 | 3 | <title> |
minqi@4267 | 4 | C2 Replay |
minqi@4267 | 5 | </title> |
minqi@4267 | 6 | </head> |
minqi@4267 | 7 | <body> |
minqi@4267 | 8 | |
minqi@4267 | 9 | <h1>C2 compiler replay</h1> |
minqi@4267 | 10 | <p> |
minqi@4267 | 11 | The C2 compiler replay is a function to repeat the compiling process from a crashed java process in compiled method<br> |
minqi@4267 | 12 | This function only exists in debug version of VM |
minqi@4267 | 13 | </p> |
minqi@4267 | 14 | <h2>Usage</h2> |
minqi@4267 | 15 | <pre> |
minqi@4267 | 16 | First, use SA to attach to the core file, if suceeded, do |
minqi@4267 | 17 | clhsdb>dumpreplaydata <address> | -a | <thread_id> [> replay.txt] |
minqi@4267 | 18 | create file replay.txt, address is address of Method, or nmethod(CodeBlob) |
minqi@4267 | 19 | clhsdb>buildreplayjars [all | boot | app] |
minqi@4267 | 20 | create files: |
minqi@4267 | 21 | all: |
minqi@4267 | 22 | app.jar, boot.jar |
minqi@4267 | 23 | boot: |
minqi@4267 | 24 | boot.jar |
minqi@4267 | 25 | app: |
minqi@4267 | 26 | app.jar |
minqi@4267 | 27 | exit SA now. |
minqi@4267 | 28 | Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java |
minqi@4267 | 29 | java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -XX:+ReplayCompiles .... |
minqi@4267 | 30 | This will replay the compiling process. |
minqi@4267 | 31 | |
minqi@4267 | 32 | With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app. |
minqi@4267 | 33 | |
minqi@4267 | 34 | notes: |
minqi@4267 | 35 | 1) Most time, we don't need the boot.jar which is the classes loaded from JDK. It will be only modified when an agent(JVMDI) is running and modifies the classes. |
minqi@4267 | 36 | 2) If encounter error as "<flag>" not found, that means the SA is using a VMStructs which is different from the one with corefile. In this case, SA has a utility tool vmstructsdump which is located at agent/src/os/<os>/proc/<os_platform> |
minqi@4267 | 37 | |
minqi@4267 | 38 | Use this tool to dump VM type library: |
minqi@4267 | 39 | vmstructsdump libjvm.so > <type_name>.db |
minqi@4267 | 40 | |
minqi@4267 | 41 | set env SA_TYPEDB=<type_name>.db (refer different shell for set envs) |