You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/11/26 17:36:01 UTC
[GitHub] [activemq-artemis] franz1981 commented on pull request #3363: ARTEMIS-3016 Reduce DuplicateIDCache memory footprint
franz1981 commented on pull request #3363:
URL: https://github.com/apache/activemq-artemis/pull/3363#issuecomment-734419440
@gtully I'm going to add a JMH benchmark to measure that performance hasn't regressed too.
First tests using 100 caches with 20K elements and `persist` shows a big improvement; I think this could be further improved by playin' a bit dirty with Object Oriented Programming :yum:
Test:
```java
public static void main(String[] args) throws Exception {
final int caches = 100;
final int capacity = 20_000;
final byte[][] ids = new byte[capacity][];
for (int c = 0; c < capacity; c++) {
ids[c] = java.util.UUID.randomUUID().toString().getBytes();
}
DuplicateIDCache[] cc = new DuplicateIDCache[caches];
for (int i = 0; i < caches; i++) {
DuplicateIDCache c = new DuplicateIDCacheImpl(new SimpleString("test"), capacity, new NullStorageManager(), true);
for (int j = 0; j < capacity; j++) {
c.addToCache(ids[j], null, true);
}
cc[i] = c;
}
System.out.println("Press a key after performing an heap dump to stop...");
System.in.read();
for (DuplicateIDCache cache : cc) {
cache.clear();
}
}
```
` master` is using `280 MB` vs this PR `190 MB`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org