Pgx OutOfMemoryError: maximum off-heap size is configured to not exceed 8,192 MBs

Pgx OutOfMemoryError: maximum off-heap size is configured to not exceed 8,192 MBs

我遇到了 PGX API of Oracle 的问题。

我加载了一个大图并应用了连续的过滤器,但在计算了一些计算之后我破坏了临时图。

GraphChangeSet<Integer> subGraphChangeSet = 
currentSubGraph.createChangeSet();
    list.forEach(v -> subGraphChangeSet.updateVertex((Integer) v.getId())
            .setProperty("BLOCKED", true));

PgxGraph subGraphForRequest = subGraphChangeSet.build();

// ...

PgxGraph subGraphFiltered = subGraphForRequest
                .filter(new VertexFilter("vertex.BLOCKED == true"));

float edges = (float) subGraphFiltered.getNumEdges();

PgqlResultSet results = subGraphFiltered.queryPgql("SELECT label(e), COUNT(*) " +
                "MATCH () -[e]-> () GROUP BY label(e) ");

for (PgxResult result: results)
    map.put(property, (float) result.getLong(2) / edges);

subGraphFiltered.destroy();
subGraphForRequest.destroy();

但是当我尝试执行查询时出现 [ERROR] OutOfMemoryError: QUERY_PGQL failed maximum off-heap size is configured to not exceed 8,192 MBs. 异常。

所以我尝试使用 VM OPTS -Xms512m -Xmx4g,但 PGX 仍然忽略这些参数。我什至尝试 -XX:-UseGCOverheadLimit 但什么也没发生。我试图修改 pgx.conf 文件以更改 max_off_heap_size 参数的值,但也没有任何反应。

经过更多研究,我在文档中发现我们可以使用系统属性

System properties

Also, any PGX engine or runtime field can be set via Java system properties by writing -Dpgx.= arguments to the JVM PGX is running on. Note: Setting system properties will overwrite any other configuration. For example, to set the max off-heap size to 256GB, regardless of what another configurations says, use

java -Dpgx.max_off_heap_size=256000 ...

PGX Doc

这对我有用。