RFR: 8000617: It should be possible to allocate memory without the VM dying.

Nils Loodin nils.loodin at oracle.com
Wed Oct 10 14:14:03 PDT 2012


On Oct 10, 2012, at 22:33 , Yumin Qi wrote:

> Hi, Nils
> 
>   As I know we did not use 'std' in hotspot code.

Hey Yumin! This isn't true, NMT code is already using std::nothrow. 
You can see it in memtracker.cpp, and also Thread already accepted std::nothrow, even if it wasn't set as const, so it couldn't really be used..

Regards,
Nils Loodin

> 
> Thanks
> Yumin
> 
> 
> On 10/10/2012 1:01 PM, Nils Loodin wrote:
>> 
>> Hi all!
>> 
>> When looking to implement a feature where I wanted to do some allocations without the vm calling vm_exit_no_memory() when not able to allocate, I discovered this wasn't possible with ResourceObj-type obects. (It was however implemented in CHeapObj-type objects.
>> 
>> Here's a patch to implement that.
>> 
>> Now we can use (for instance) jcmd on a running production vm without fear that we will bring the vm down if the jcmd commands does allocations.
>> (The commands themselves have to be implemented with this in mind though.)
>> 
>> Webrev here:
>> http://cr.openjdk.java.net/~nloodin/8000617/webrev.01/
>> 
>> Regards,
>> Nils Loodin



More information about the hotspot-dev mailing list