JDK-8163146 : Remove os::check_heap on Windows
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2016-08-04
  • Updated: 2023-10-17
  • Resolved: 2016-08-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u401Fixed 9 b135Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
os::check_heap seems to be buggy on Windows (see JDK-8147481, JDK-8148813, JDK-8147481). 

We have actually never fixed an actual bug with os::check_heap(). All we see are (a) bugs inside the implementation of  os::check_heap(), (b) seemingly bugs inside HeapValidate() and (c) unreproducible crashes which are probably because of (b):

https://bugs.openjdk.java.net/issues/?jql=text%20~%20%22os%3A%3Acheck_heap%22

So instead of spending useless efforts for checking the heap dump, we should disable this feature with a develop flag, such as UseOSHeapChecking.
Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/03762a0cf7e1 User: lana Date: 2016-09-07 20:26:04 +0000
07-09-2016

URL: http://hg.openjdk.java.net/jdk9/hs/hotspot/rev/03762a0cf7e1 User: ctornqvi Date: 2016-08-24 17:09:34 +0000
24-08-2016

https://msdn.microsoft.com/en-us/library/windows/hardware/ff549561(v=vs.85).aspx using gflags would enable checks on every malloc/free call instead of every now and then.
09-08-2016

Since the error in hotspot nightly doesn't happen very often, and MallocVerifyInterval might be a useful feature by some Windows users, let's defer the fix to the next release so we can have more community discussion.
09-08-2016

[~ctornqvi] if we completely remove os::check_heap for Windows, is there a way to simulate the existing MallocVerifyInterval flag with native Windows tools such as gflags and windbg? Can that be done in command line?
08-08-2016

Or remove the code since we have better alternatives than using the flag?
04-08-2016

I agree, it's better to do heap checking using gflags or heap debugging in windbg when needed.
04-08-2016