Skip to content

Commit 26e19fe

Browse files
WIP
Co-authored-by: Martin Junghanns <martin.junghanns@neo4j.com>
1 parent aeb3443 commit 26e19fe

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

applications/graph-store-catalog-results/src/main/java/org/neo4j/gds/applications/graphstorecatalog/GraphMemoryUsage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import org.neo4j.gds.api.GraphStore;
2424
import org.neo4j.gds.core.loading.CSRGraphStore;
2525
import org.neo4j.gds.core.loading.GraphStoreCatalogEntry;
26-
import org.neo4j.gds.mem.MemoryUsage;
2726
import org.neo4j.gds.mem.Estimate;
27+
import org.neo4j.gds.mem.MemoryUsage;
2828
import org.openjdk.jol.info.GraphWalker;
2929

3030
import java.util.Collections;
@@ -40,7 +40,7 @@ public final class GraphMemoryUsage {
4040
public final long nodeCount;
4141
public final long relationshipCount;
4242

43-
static GraphMemoryUsage of(GraphStoreCatalogEntry graphStoreCatalogEntry) {
43+
public static GraphMemoryUsage of(GraphStoreCatalogEntry graphStoreCatalogEntry) {
4444
var totalSize = new MutableLong();
4545
var graphStore = graphStoreCatalogEntry.graphStore();
4646
var detailMemory = internalSizeOfGraph(graphStore, totalSize);

core/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dependencies {
1414
compileOnly openGds.immutables.builder
1515
compileOnly openGds.immutables.value.annotations
1616
compileOnly openGds.jetbrains.annotations
17+
implementation openGds.jol.core
18+
1719
compileOnly project(':progress-tracking')
1820

1921
compileOnly group: 'org.neo4j', name: 'annotations', version: ver.'neo4j'

core/src/main/java/org/neo4j/gds/core/loading/GraphStoreCatalog.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
import org.neo4j.gds.api.graph.store.catalog.GraphStoreRemovedEvent;
3131
import org.neo4j.gds.api.graph.store.catalog.GraphStoreRemovedEventListener;
3232
import org.neo4j.gds.config.GraphProjectConfig;
33+
import org.neo4j.gds.core.GraphMemoryUsage;
3334
import org.neo4j.gds.logging.Log;
34-
import org.neo4j.gds.mem.MemoryUsage;
3535
import org.neo4j.gds.utils.ExceptionUtil;
3636
import org.neo4j.gds.utils.StringJoining;
3737

@@ -63,6 +63,7 @@ private GraphStoreCatalog() {
6363

6464
public static void registerGraphStoreAddedListener(GraphStoreAddedEventListener listener) {
6565
graphStoreAddedEventListeners.add(listener);
66+
6667
}
6768

6869
public static void unregisterGraphStoreAddedListener(GraphStoreAddedEventListener listener) {
@@ -210,7 +211,7 @@ public static void set(GraphProjectConfig config, GraphStore graphStore) {
210211
config.username(),
211212
graphStore.databaseInfo().databaseId().databaseName(),
212213
config.graphName(),
213-
MemoryUsage.sizeOf(graphStore)
214+
GraphMemoryUsage.of(new GraphStoreCatalogEntry(graphStore,config,null)).sizeInBytes
214215
)
215216
),
216217
log.orElseGet(Log::noOpLog)::warn
@@ -427,7 +428,7 @@ private boolean remove(
427428
config.username(),
428429
graphStore.databaseInfo().databaseId().databaseName(),
429430
config.graphName(),
430-
MemoryUsage.sizeOf(graphStore)
431+
GraphMemoryUsage.of(new GraphStoreCatalogEntry(graphStore,config,null)).sizeInBytes
431432
)
432433
),
433434
log.orElseGet(Log::noOpLog)::warn

0 commit comments

Comments
 (0)