8159799: Tests using jcmd fails intermittently with Could not open PerfMemory on Windows
Reviewed-by: gtriantafill, dholmes, sla, fparain
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp Tue Oct 18 06:14:10 2016 -0400
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp Tue Oct 18 06:17:10 2016 -0400
@@ -1404,12 +1404,14 @@
objectname); /* name for object */
if (fmh == NULL) {
+ DWORD lasterror = GetLastError();
if (PrintMiscellaneous && Verbose) {
warning("OpenFileMapping failed for shared memory object %s:"
- " lasterror = %d\n", objectname, GetLastError());
+ " lasterror = %d\n", objectname, lasterror);
}
- THROW_MSG_(vmSymbols::java_lang_Exception(),
- "Could not open PerfMemory", INVALID_HANDLE_VALUE);
+ THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
+ err_msg("Could not open PerfMemory, error %d", lasterror),
+ INVALID_HANDLE_VALUE);
}
return fmh;;