Per-entry overhead - some questions

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

Per-entry overhead - some questions

endianignite
Hi Igniters,

I have been looking in to the per-entry overhead for Ignite cache entries
and have a couple of questions.

1. Does each GridCacheMapEntry require a reference to GridCacheContext<?, ?>
or could this field be removed/optimized in some way? Is the
GridCacheContext instance the same for every entry in a particular cache?

2. Is the GridCacheMapEntry extras field (a reference to
GridCacheEntryExtras) often/usually null? If so, could we find a clever way
to remove this field and save a further 8 bytes?

The reason for asking is that I am looking at a use-case where object sizes
are very small, but the number of objects is very large, and therefore the
overhead is substantial.  In this particular case, the overhead is 70-75% of
the consumed memory.

I look forward to hearing your thoughts.

Regards
Mike



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Per-entry overhead - some questions

Alexey Goncharuk
Hello Mike,

With the new Ignite 2.0 architecture, GridCacheMapEntry does not add any
overhead because the data is stored off-heap (unless you have on-heap cache
enabled) and the GridCacheMapEntry is created only temporarily.

Anyways, answering your questions:
1) The reference to GridCacheContext in all entries of the same cache is
the same. Theoretically, it may be possible to pass this reference to every
single method on GridCacheMapEntry, however, there might be tricky places
when the context is not around in local variables, so this task may require
quite a bit of refactoring.
2) GridCacheEntryExtras usage pattern depends on whether this is a
transactional or atomic cache. Back in Ignite 1.x I would say that this
field is null most of the time, but in Ignite 2.x, again, it is very likely
that extras are not null when the entry is used.

--AG

2017-09-26 18:19 GMT+03:00 endianignite <[hidden email]>:

> Hi Igniters,
>
> I have been looking in to the per-entry overhead for Ignite cache entries
> and have a couple of questions.
>
> 1. Does each GridCacheMapEntry require a reference to GridCacheContext<?,
> ?>
> or could this field be removed/optimized in some way? Is the
> GridCacheContext instance the same for every entry in a particular cache?
>
> 2. Is the GridCacheMapEntry extras field (a reference to
> GridCacheEntryExtras) often/usually null? If so, could we find a clever way
> to remove this field and save a further 8 bytes?
>
> The reason for asking is that I am looking at a use-case where object sizes
> are very small, but the number of objects is very large, and therefore the
> overhead is substantial.  In this particular case, the overhead is 70-75%
> of
> the consumed memory.
>
> I look forward to hearing your thoughts.
>
> Regards
> Mike
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Per-entry overhead - some questions

endianignite
Thanks Alexey, understood.

What is the format of the object that is stored off-heap, is it a
BinaryObjectOffheapImpl (or a parent class/interface) or something else?





--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Per-entry overhead - some questions

Alexey Goncharuk
Yes, Basically, it is a pair of backing arrays of key and value as
BinaryObjects, associated GridCacheVersion and expireTime (I may have
forgotten something, but this something should not be too large). You can
take a closer look at WriteRowHandler class which runs the row store to a
data page to dig into the key-value row layout.

2017-09-27 17:45 GMT+03:00 endianignite <[hidden email]>:

> Thanks Alexey, understood.
>
> What is the format of the object that is stored off-heap, is it a
> BinaryObjectOffheapImpl (or a parent class/interface) or something else?
>
>
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>