Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 533915 - Acquire heap dump not working with IBM JDK 1.8
Summary: Acquire heap dump not working with IBM JDK 1.8
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: 1.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.8.0   Edit
Assignee: Andrew Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-22 12:40 EDT by Andrew Johnson CLA
Modified: 2018-05-18 04:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2018-04-22 12:40:10 EDT
Acquire heap dumps is not working with the latest versions of IBM JDK 1.8 - no processes are listed.

See https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0.0/com.ibm.java.win.80.doc/user/attachapi.html 
where there is this comment:

From Service Refresh 5, the exceptions change as follows:
com.sun.tools.attach.AgentLoadException
com.sun.tools.attach.AgentInitializationException
com.sun.tools.attach.AgentNotSupportedException
com.sun.tools.attach.AttachOperationFailedException
java.io.IOException

Examining the VM with Javap it appears that it is not just the exceptions that have changed; the classes have changed too:
javap.exe com.sun.tools.attach.VirtualMachine

Currently the MAT classes calling the IBM classes are isolated in src2/org/eclipse/mat/ibmdumps
and are compiled with an appropriate IBM VM - then the classes are copies to classes/org/eclipse/mat/ibmdumps

This won't be convenient for changing the classes from com.sun to com.sun
Comment 1 Andrew Johnson CLA 2018-04-22 12:41:47 EDT
The best solution is probably to call all the com.ibm and com.sun classes via reflection so that the MAT classes can be recompiled on any JVM.
Comment 2 Eclipse Genie CLA 2018-04-22 15:15:07 EDT
New Gerrit change created: https://git.eclipse.org/r/121534
Comment 4 Andrew Johnson CLA 2018-04-23 06:11:48 EDT
There was another problem - if with 'IBM dump (using helper VM)' the -vmoptions was changed from '-version:1.6+' to '-version:1.6' then it failed to list the VMS, as expected as no version=1.6 JVM was found.
If the vmoptions were changed back to '-version:1.6+' then it still didn't work as the options used were still '-version:1.6'.

This was because the changed options were the default values and were removed from the argument set, but the missing default arguments were not then set in the configuration object.
Comment 5 Eclipse Genie CLA 2018-04-23 15:10:34 EDT
New Gerrit change created: https://git.eclipse.org/r/121598
Comment 7 Eclipse Genie CLA 2018-04-25 06:37:44 EDT
New Gerrit change created: https://git.eclipse.org/r/121717
Comment 9 Eclipse Genie CLA 2018-04-25 14:50:46 EDT
New Gerrit change created: https://git.eclipse.org/r/121758
Comment 11 Eclipse Genie CLA 2018-04-25 16:34:32 EDT
New Gerrit change created: https://git.eclipse.org/r/121763
Comment 13 Eclipse Genie CLA 2018-04-27 08:22:06 EDT
New Gerrit change created: https://git.eclipse.org/r/121861
Comment 15 Eclipse Genie CLA 2018-04-27 11:55:29 EDT
New Gerrit change created: https://git.eclipse.org/r/121889
Comment 17 Eclipse Genie CLA 2018-04-29 03:12:48 EDT
New Gerrit change created: https://git.eclipse.org/r/121911
Comment 19 Eclipse Genie CLA 2018-04-30 07:50:38 EDT
New Gerrit change created: https://git.eclipse.org/r/121924
Comment 21 Eclipse Genie CLA 2018-05-03 17:45:05 EDT
New Gerrit change created: https://git.eclipse.org/r/122143
Comment 23 Eclipse Genie CLA 2018-05-05 08:00:58 EDT
New Gerrit change created: https://git.eclipse.org/r/122214
Comment 24 Eclipse Genie CLA 2018-05-05 08:24:12 EDT
New Gerrit change created: https://git.eclipse.org/r/122215
Comment 26 Eclipse Genie CLA 2018-05-05 08:58:50 EDT
New Gerrit change created: https://git.eclipse.org/r/122216
Comment 28 Eclipse Genie CLA 2018-05-05 13:17:16 EDT
New Gerrit change created: https://git.eclipse.org/r/122218
Comment 30 Andrew Johnson CLA 2018-05-05 16:28:17 EDT
Updates include - 
IBM dump provider now works with com.sun.tools.attach API too
- so renamed Attach API provider
- wrapped handling of com.ibm / com.sun objects
HPROF dump option added to Attach API provider
HPROF dumps generated using HotSpot MX bean
- dump option to remove live objects on taking the dump
UI updates to resize tables better
UI jumps to correct configuration table for a provider
More documentation.
Comment 31 Eclipse Genie CLA 2018-05-06 07:20:56 EDT
New Gerrit change created: https://git.eclipse.org/r/122226
Comment 33 Eclipse Genie CLA 2018-05-10 13:53:23 EDT
New Gerrit change created: https://git.eclipse.org/r/122439
Comment 35 Andrew Johnson CLA 2018-05-17 16:58:24 EDT
Also - unavailable dumps are greyed out.

The original feature was https://bugs.eclipse.org/bugs/show_bug.cgi?id=229449

Add some more changes to disable dumping from a process if an attempt threw AttachNotSupportedException
Comment 36 Andrew Johnson CLA 2018-05-18 03:58:52 EDT
This is now generally working.