Skip to content

Commit

Permalink
This "removes" set is only written, never read
Browse files Browse the repository at this point in the history
-this set grows unbounded so it was implicated in some memory leak tests
-unless we are going to use it (in which case we need to limit it), it should be removed
  • Loading branch information
jeff-aion authored and AionJayT committed May 27, 2019
1 parent dcacc1d commit b8f41ab
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions modMcf/src/org/aion/mcf/db/DetailsDataStore.java
Expand Up @@ -26,7 +26,6 @@ public class DetailsDataStore<
private ByteArrayKeyValueDatabase detailsSrc;
private ByteArrayKeyValueDatabase storageSrc;
private ByteArrayKeyValueDatabase graphSrc;
private Set<ByteArrayWrapper> removes = new HashSet<>();

public DetailsDataStore() {}

Expand Down Expand Up @@ -64,10 +63,6 @@ public synchronized ContractDetails get(byte[] key) {

// If it doesn't exist in cache or database.
if (!rawDetails.isPresent()) {

// Check to see if we have to remove it.
// If it isn't in removes set, we add it to removes set.
removes.add(wrappedKey);
return null;
}

Expand All @@ -92,16 +87,11 @@ public synchronized void update(Address key, ContractDetails contractDetails) {
detailsSrc.put(key.toBytes(), rawDetails);

contractDetails.syncStorage();

// Remove from the remove set.
removes.remove(wrappedKey);
}

public synchronized void remove(byte[] key) {
ByteArrayWrapper wrappedKey = wrap(key);
detailsSrc.delete(key);

removes.add(wrappedKey);
}

public synchronized void flush() {
Expand Down

0 comments on commit b8f41ab

Please sign in to comment.