off heap memory deallocation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

off heap memory deallocation

Janardhan Reddy
Hi,

When does off heap memory gets deallocated ? Does it get deallocated only when gc is triggered ? When does the gc gets triggered other than when the direct memory reached -XX::MaxDirectMemory limit passed in jvm flag.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: off heap memory deallocation

Maximilian Michels
Hi,

Off-heap memory currently only gets deallocated once MaxDirectMemory
has been reached. We can't manually clear the memory because some of
the code assumes that it can still access old memory after it has been
released. In case of offheap memory, that would give us a segmentation
fault.

We currently recommend not to use offheap memory with lazy memory
allocation (preallocation: false).

Best,
Max

On Wed, Aug 17, 2016 at 8:01 PM, Janardhan Reddy
<[hidden email]> wrote:
> Hi,
>
> When does off heap memory gets deallocated ? Does it get deallocated only
> when gc is triggered ? When does the gc gets triggered other than when the
> direct memory reached -XX::MaxDirectMemory limit passed in jvm flag.
>
> Thanks