RFR: 8252842: Extend jmap to support parallel heap dump
Lin Zang
lzang at openjdk.java.net
Wed Jan 27 13:17:40 UTC 2021
On Wed, 27 Jan 2021 12:49:29 GMT, Lin Zang <lzang at openjdk.org> wrote:
> 8252842: Extend jmap to support parallel heap dump
Dear All,
I have made a draft patch on parallel heap dump of jmap.
This patch is still WIP with test case under development and code refining is in process.
But I want to firstly ask your help to discuss a potential compatibility issue that may need to solve:
This patch introduces a new "parallel" option to jmap, so after this patch, there can be at most 4 options for jmap that can be passed to JDK.
The issue is that there is a limitation in old version of jmap that at most 3 arguments can be accepted. As I commented in File JMap.java. and I can not simply enlarge the limitation to 4 because that will cause old version of jmap hang when working on new JDK.
So I use the 3rd argument of jmap to be a combined string and parse it to JDK, and the attachListener.cpp is modified to add the logic for parsing it to get gzlevel and parallel thread number.
The current status is that, with current change in this patch, old jmap could work normally on new JDK, and new jmap without "parallel" could work correctly with old JDK.
But the problem comes when new jmap use "gz=1, parallel=2" options together to communicate to an old JDK, the "gz" option takes no effect. The root cause is that old JDK's attachListener.cpp does not have the parsing logic, so it treat "gz=1, parallel=2" as a whole argument, and hence can not recognize it.
May I ask your suggestion to see whether this is behavior is acceptable, and if not, any advice for fixing the compatibility issue?
Thanks!
Lin
-------------
PR: https://git.openjdk.java.net/jdk/pull/2261
More information about the serviceability-dev
mailing list