Skip to content

Commit dc0c9f5

Browse files
committed
mapped everything
1 parent 49b1538 commit dc0c9f5

25 files changed

Lines changed: 1224 additions & 292 deletions

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SketchBasedJoinEstimator.java

Lines changed: 167 additions & 112 deletions
Large diffs are not rendered by default.

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SketchEstimatorMemoryMonitor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ private void run() {
7575

7676
void checkMemory() {
7777
double heapPressure = (double) memoryProbe.usedHeapBytes() / Math.max(1L, memoryProbe.maxMemoryBytes());
78+
// if (heapPressure > 0.5) {
79+
// System.out.println("Heap pressure: " + (int) (heapPressure * 100) + "%");
80+
// }
7881
if (heapPressure < memoryPolicy.highMemoryPressurePercent) {
7982
evictionController.enforceResidentCeiling();
8083
return;
@@ -83,6 +86,11 @@ void checkMemory() {
8386
while (!closed && heapPressure >= memoryPolicy.highMemoryPressurePercent
8487
&& evictionController.activeLoadedBucketCount() > floor) {
8588
int evicted = evictionController.evictLruBatch(memoryPolicy.memoryPressureUnloadBatchSize);
89+
System.gc();
90+
logger.warn(
91+
"High memory pressure detected ({}% used), evicted {} loaded buckets, active loaded buckets: {}, heap pressure after eviction: {}%",
92+
(int) (heapPressure * 100), evicted, evictionController.activeLoadedBucketCount(),
93+
(int) (heapPressure * 100));
8694
if (evicted <= 0) {
8795
return;
8896
}

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SketchEstimatorMemoryPolicy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ private SketchEstimatorMemoryPolicy(int bucketCount, int sketchNominalEntries, b
6262
static SketchEstimatorMemoryPolicy resolve(SketchBasedJoinEstimator.Config config,
6363
SketchEstimatorMemoryProbe memoryProbe) {
6464
long maxMemoryBytes = Math.max(1L, memoryProbe.maxMemoryBytes());
65-
double estimatorBudget = clampPercent(config.estimatorMemoryBudgetPercent, 0.50d);
66-
double residentTarget = clampPercent(config.residentSketchMemoryTargetPercent, 0.25d);
65+
double estimatorBudget = clampPercent(config.estimatorMemoryBudgetPercent, 0.70d);
66+
double residentTarget = clampPercent(config.residentSketchMemoryTargetPercent, 0.50d);
6767
double residentCeiling = Math.max(residentTarget,
68-
clampPercent(config.residentSketchMemoryCeilingPercent, 0.30d));
69-
double highPressure = clampPercent(config.highMemoryPressurePercent, 0.80d);
68+
clampPercent(config.residentSketchMemoryCeilingPercent, 0.70d));
69+
double highPressure = clampPercent(config.highMemoryPressurePercent, 0.75d);
7070
double loadedFloor = clampPercent(config.loadedBucketFloorPercent, 0.05d);
7171

7272
int bucketCount = Math.max(MIN_BUCKET_COUNT, config.nominalEntries);

0 commit comments

Comments
 (0)