Duplicates data in sonia.cache.cmd.log

jedevivie avatarjedevivie created an issue

Hi Sebastian,

Since 1.30, cache limits works so i no more run out of memory. So, i have set this issue as minor.

I have logged 7 times with a different account and w/ scm-activity-plugin enabled. As i have to wait, it seems that changes sets are reread from disk each time. So, i have dumped memory and done a quick analyse (pls see here-attached a snapshot).

The structure com.google.common.cache.LocalCache$StrongAccessEntry contains exactly the same ChangeSet lists and is duplicated 7 times (exactly the number of different logins). The sonia.scm.repository.api.logCommandBuilder$CacheKey differs only by its request field, but not by changesetId or repositoryId. As CacheKey differs, the cache container com.google.common.cache.LocalCache$StrongAccessEntry might be also duplicated with lots of changesets inside.

Could you have a look, pls ? Thank you

BR Jérôme

Comments (7)

  1. Sebastian Sdorra
    • changed status to open

    SCM-Manager reads the changests again from disk, because the maximum size limit is reached. The default maximum for log cache is 500 and this too low for your setup. You can override the settings for the log cache by creating a file at .scm/ext/gcache.xml with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <caches>
    
      <cache
        name="sonia.cache.cmd.log"
        maximumSize="1000"
        copyStrategy="read-write"
      />
    
    </caches>
    

    It is very complicated to avoid such duplicate cache entries.

  2. jedevivie

    --=alternative 002CE1F0C1257B4E= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1

    Hi Sebastian,

    I have set limit to 10000 objects in cmd.log cache and do not exceed it dur= ing my test.=20 Even w/o reaching this limit, changeset are duplicated in memory

    BR J=E9r=F4me

  3. Sebastian Sdorra

    Hi, sorry for the long delay. But i've started to implement a new caching strategy for the activity plugin. With this new caching strategy i will no longer use the default cache for git repositories. Instead of the default cache i will use a new cache which caches only the 20 newest changeset of all branches instead of 20 changesets of every branch. This change should drastically reduce the memory overhead in large environments with many branches. This changes require a small change to the core of scm-manager, so the new version of the activity plugin will be only available for version 1.32 or newer of scm-manager.

    Change:

  4. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.