Skip to content

Commit dac4194

Browse files
committed
Add documentation and README for memoryUsage and sizeInBytes for graph.list
1 parent 55a7eb6 commit dac4194

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

doc/modules/ROOT/pages/graph-list.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ CALL gds.graph.list(
5353
| density | Float | Density of the graph.
5454
| creationTime | Datetime | Time when the graph was projected.
5555
| modificationTime | Datetime | Time when the graph was last modified.
56-
| sizeInBytes | Integer | Number of bytes used in the Java heap to store the graph.
57-
| memoryUsage | String | Human readable description of `sizeInBytes`.
56+
| sizeInBytes | Integer | Number of bytes used in the Java heap to store the graph. This feature is not supported on all JDKs and might return -1 instead.
57+
| memoryUsage | String | Human readable description of `sizeInBytes`. This feature is not supported on all JDKs and might return null instead.
5858
|===
5959
--
6060

proc/catalog/src/main/java/org/neo4j/gds/catalog/GraphInfo.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ static GraphInfo withMemoryUsage(
8686
GraphStore graphStore
8787
) {
8888
var sizeInBytes = MemoryUsage.sizeOf(graphStore);
89-
var memoryUsage = MemoryUsage.humanReadable(sizeInBytes);
89+
90+
var memoryUsage = sizeInBytes >= 0
91+
? MemoryUsage.humanReadable(sizeInBytes)
92+
: null;
9093

9194
return create(
9295
graphProjectConfig,

0 commit comments

Comments
 (0)