Suggested fix for JDK-4724038 (Add unmap method to MappedByteBuffer)

David Holmes david.holmes at
Fri Sep 11 10:00:57 UTC 2015

On 11/09/2015 6:37 PM, Andrew Haley wrote:
> On 09/11/2015 07:15 AM, David Holmes wrote:
>> On 11/09/2015 12:56 AM, Vitaly Davidovich wrote:
>>>> Sure, if you like, but that's a detail.  We are arguing about what
>>>> colour to paint the bike shed.  :)
>>> The reason it may be more than just a bikeshed is because if this requires
>>> more cleverness in the segfault handler, then it's yet more work to make
>>> this happen.  I agree it's an implementation detail, but I don't think it's
>>> trivial (unless someone comes along and says that modifying the trap
>>> handler to account for this type of scenario is trivial).  One would also
>>> need to modify the safepoint code in the VM to allow skipping all the
>>> housekeeping it does typically, but I suspect this part is fairly easy.
>> Not sure how the safepoint code is supposed to know this particular
>> safepoint is "special".
> I guess I don't know what the problem is: when you request a safepoint you
> also pass a code saying what you want to happen.

There are actions that can also happen at a safepoint that are not part 
of the VMOperation for which the safepoint was initiated:

// Various cleaning tasks that should be done periodically at safepoints
void SafepointSynchronize::do_cleanup_tasks() {
     TraceTime t1("deflating idle monitors", TraceSafepointCleanupTime);

     TraceTime t2("updating inline caches", TraceSafepointCleanupTime);
     TraceTime t3("compilation policy safepoint handler", 

     TraceTime t4("mark nmethods", TraceSafepointCleanupTime);

   if (SymbolTable::needs_rehashing()) {
     TraceTime t5("rehashing symbol table", TraceSafepointCleanupTime);

   if (StringTable::needs_rehashing()) {
     TraceTime t6("rehashing string table", TraceSafepointCleanupTime);

   // rotate log files?
   if (UseGCLogFileRotation) {

     // CMS delays purging the CLDG until the beginning of the next 
safepoint and to
     // make sure concurrent sweep is done
     TraceTime t7("purging class loader data graph", 

All the above happens at the end of SafepointSynchronize::begin, before 
the VMOperation is processed.


> Andrew.

More information about the core-libs-dev mailing list