General Questions

Expand all | Collapse all

How to know whether memory used by a cache or a set

  • 1.  How to know whether memory used by a cache or a set

     
    Posted 06-14-2019 09:35 AM
    I'm rather new to GridGain Community Edition. I have a question: because I have multiple processes running that compute files in my GCE H2 database, I would like to see how memory is being been used by either caches and sets. I don't have persistence turned on and when I try to use the MxBean for CacheGroup, it send me back a 0.
    Does anyone have any ideas what I'm doing wrong here? 
    Much appreciated!


    ------------------------------
    -Elwood
    ------------------------------


  • 2.  RE: How to know whether memory used by a cache or a set

    This message was posted by a user wishing to remain anonymous
    Posted 06-20-2019 07:27 AM
    This post was removed


  • 3.  RE: How to know whether memory used by a cache or a set

    Posted 06-20-2019 08:33 AM
    I guess you need to enable cache statistics to see those values as non-zero. CacheConfiguration.setStatisticsEnabled(). While you're at it, enable statistics on data regions if you have specified them explicitly!

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 4.  RE: How to know whether memory used by a cache or a set

    Posted 09-26-2019 07:32 AM
    Hi, Ilya!
    Unfortunately, CacheGroupMetricsMxBean#getTotalAllocatedPages returns 0 if persistence is disabled, regardless of CacheConfiguration#setStatisticsEnabled() and both DataRegion, DataStorage  #setMetricsEnabled​.

    And CacheMetrics#getOffHeapAllocatedSize​​ also always return 0.

    So I'm still in searches how to evaluate memory consumed by a cache. Please advice.

    ------------------------------
    Sergey Kosarev
    Engineer
    Deutsche Bank
    macrergate@gmail.com
    ------------------------------



  • 5.  RE: How to know whether memory used by a cache or a set

    Posted 10-01-2019 07:26 AM
    Hello!

    I don't think GridGain keeps precise per-cache accounting in in-memory mode. You can still use
    ignite.dataRegionMetrics("default").getTotalAllocatedPages()
    You can place caches that needs to be accounted separately to different data regions.

    Regards,

    ------------------------------
    Ilya Kasnacheev
    Community Support Specialist
    GridGain
    ------------------------------



  • 6.  RE: How to know whether memory used by a cache or a set

    Posted 10-07-2019 04:18 AM
    Hello I'm facing the same problem.

    And more of that, as Ignite use an internal reuse list, totalallocated page could be not exact, when data are dropped.
    So, as some people said to me in Ignite forum, I did check in inernal API.

    As I don't have righs to past some code, so I will just explain what I did.

    First, I casted my Ignite instance to IgniteKernal.
    Then, using reflection, I took the "ctx" private field as GridKernalContextImpl. 
    Using it, I get the cache group concerning my caches. 
    Inside it I get the resuseList and call recycledPagesCount.

    So my used memory is ( DataRegion.metric.allocatedPages - recycledPagesCount ) * DataRegionMetrics.getPageSize

    Perhaps there is something simpler, but it could help.

    Regards.

    ------------------------------
    Yann Blazart
    tech lead
    BNP SIT
    BNP SIT
    ------------------------------



Would you attend a July Meetup?


Announcements