You need to do a lot more reading of the source. A java String is not a 
CHeapObj, and nether is any other Java class...

On Friday, November 17, 2017 at 2:46:30 PM UTC-8, John Hening wrote:
>
> I am reading source of HotSpot sourcode src/share/vm/memory/allocation.hpp 
> and I see:
>
> // All classes in the virtual machine must be subclassed
>> // by one of the following allocation classes:
>> //
>> // For objects allocated in the resource area (see resourceArea.hpp).
>> // - ResourceObj
>> //
>> // For objects allocated in the C-heap (managed by: free & malloc).
>> // - CHeapObj
>
>
> For my eye, common objects in Java, like 
>
> new String();
>
> is a CHeapObj. I looked at an implementation of new operator in that class 
> and it looks like:
>
> void* CHeapObj::operator new(size_t size){
>   return (void *) malloc(size);
> }
>
>
>
> No, I have no idea why it is said: allocation in Java in very fast- it is 
> fater than C++/C
>

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to