You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Deepesh Malviya <de...@gmail.com> on 2018/04/17 17:33:46 UTC

Reclaim memory from off-heap

Hi,

I have read this post -
http://apache-ignite-users.70518.x6.nabble.com/Cache-Destroy-Space-reclaim-td17208.html

I have few questions
1. Does this post is still true?
2. If cache destroy is called and is recreated, will it use same space or
it will be new allocation on off-heap?
3. Is there anyway to reclaim memory from off-heap?

Regards,
_DM

Re: Reclaim memory from off-heap

Posted by vkulichenko <va...@gmail.com>.
Deepesh,

Memory is allocated by a data region, not by a particular cache. So yes, you
can destroy and create caches in a region to reuse its memory.

-Val



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Reclaim memory from off-heap

Posted by Deepesh Malviya <de...@gmail.com>.
Hi Stan,

Thanks for the response. In our flow, we create, fill, destory and recreate
cache in a for loop. I assume it would be still able to reuse what's
already been allocated.

Regards,
Deepesh

On Wed, Apr 18, 2018 at 12:07 AM, Stanislav Lukyanov <stanlukyanov@gmail.com
> wrote:

> Hi,
>
> On Tue, Apr 17, 2018 at 8:33 PM, Deepesh Malviya <de...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have read this post - http://apache-ignite-users.7
>> 0518.x6.nabble.com/Cache-Destroy-Space-reclaim-td17208.html
>>
>> I have few questions
>> 1. Does this post is still true?
>>
> Yes.
>
>
>> 2. If cache destroy is called and is recreated, will it use same space or
>> it will be new allocation on off-heap?
>>
> Not necessarily the same space, but it will try to reuse what's already
> available.
> If Ignite has an already allocated chunk of memory that is not used by
> other caches, it will use it.
> Otherwise, a new chunk will be allocated.
>
> Other words, if you create, fill and destroy a cache 100 times, Ignite
> will not allocate memory 100 times, it will reuse what's already allocated.
>
> 3. Is there anyway to reclaim memory from off-heap?
>>
> No. Instead, you can set the maximum size of a data region via
> DataRegionConfiguration.setMaxSize().
> Once a data region hits maxSize, Ignite will not allocate more memory for
> the caches in that region.
>
> Stan
>
>


-- 
_Deepesh

Re: Reclaim memory from off-heap

Posted by Stanislav Lukyanov <st...@gmail.com>.
Hi,

On Tue, Apr 17, 2018 at 8:33 PM, Deepesh Malviya <de...@gmail.com> wrote:

> Hi,
>
> I have read this post - http://apache-ignite-users.
> 70518.x6.nabble.com/Cache-Destroy-Space-reclaim-td17208.html
>
> I have few questions
> 1. Does this post is still true?
>
Yes.


> 2. If cache destroy is called and is recreated, will it use same space or
> it will be new allocation on off-heap?
>
Not necessarily the same space, but it will try to reuse what's already
available.
If Ignite has an already allocated chunk of memory that is not used by
other caches, it will use it.
Otherwise, a new chunk will be allocated.

Other words, if you create, fill and destroy a cache 100 times, Ignite will
not allocate memory 100 times, it will reuse what's already allocated.

3. Is there anyway to reclaim memory from off-heap?
>
No. Instead, you can set the maximum size of a data region via
DataRegionConfiguration.setMaxSize().
Once a data region hits maxSize, Ignite will not allocate more memory for
the caches in that region.

Stan