Memory leak in Epinions for PostgreSQL
Hi great people of Benchbase!
There seems to be a memory leak in Benchbase when running Epinions on PostgreSQL. The memory-consumption keeps increasing steadily until the system runs out of memory. Is this something that you have observed yourself or have any idea about how to solve? Any and all insight would be welcome!
Thanks!
Hi! Thanks for reporting.
Can you please list the specifics that led to this? e.g., your relevant epinions config, driver and benchbase versions, etc.?
I'm running Epinions on a VM with 4 cores and 16 GB RAM.
Here is the beginning of the output, and it is followed by a couple of other processes failing for lack of heap space.
[INFO ] 2025-02-05 15:19:33,746 [main] com.oltpbenchmark.DBWorkload main - ======================================================================
Benchmark: EPINIONS {com.oltpbenchmark.benchmarks.epinions.EpinionsBenchmark}
Configuration: config/postgres/sample_epinions_config.xml
Type: POSTGRES
Driver: org.postgresql.Driver
URL: jdbc:postgresql://localhost:5432/benchbase?sslmode=disable&ApplicationName=epinions&reWriteBatchedInserts=true
Isolation: TRANSACTION_REPEATABLE_READ
Batch Size: 128
Scale Factor: 10000.0
Terminals: 20
New Connection Per Txn: false
Reconnect on Connection Failure: false
[INFO ] 2025-02-05 15:19:33,748 [main] com.oltpbenchmark.DBWorkload main - ======================================================================
[INFO ] 2025-02-05 15:19:34,299 [main] com.oltpbenchmark.DBWorkload runWorkload - Creating 20 virtual terminals...
[INFO ] 2025-02-05 15:20:23,308 [main] com.oltpbenchmark.DBWorkload runWorkload - Launching the EPINIONS Benchmark with 1 Phase...
[INFO ] 2025-02-05 15:20:23,323 [main] com.oltpbenchmark.ThreadBench runRateLimitedMultiPhase - PHASE START :: [Workload=EPINIONS] [Serial=false] [Time=86400] [WarmupTime=0] [Rate=unlimited] [Arrival=REGULAR] [Ratios=[10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 20.0]] [ActiveW
orkers=20]
[INFO ] 2025-02-05 15:20:24,323 [main] com.oltpbenchmark.ThreadBench runRateLimitedMultiPhase - MEASURE :: Warmup complete, starting measurements.
java.lang.OutOfMemoryError: Java heap space
Dumping heap to /tmp/heapdump ...
Heap dump file created [6968403080 bytes in 148.937 secs]
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "EpinionsWorker<015>"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "EpinionsWorker<000>"
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
[ERROR] 2025-02-06 00:10:50,546 [EpinionsWorker<018>] com.oltpbenchmark.ThreadBench uncaughtException - Self-suppression not permitted
java.lang.IllegalArgumentException: Self-suppression not permitted
at java.base/java.lang.Throwable.addSuppressed(Throwable.java:1096)
at com.oltpbenchmark.benchmarks.epinions.procedures.GetAverageRatingByTrustedUser.run(GetAverageRatingByTrustedUser.java:34)
at com.oltpbenchmark.benchmarks.epinions.EpinionsWorker.averageRatingByTrustedUser(EpinionsWorker.java:93)
at com.oltpbenchmark.benchmarks.epinions.EpinionsWorker.executeWork(EpinionsWorker.java:57)
at com.oltpbenchmark.api.Worker.doWork(Worker.java:434)
at com.oltpbenchmark.api.Worker.run(Worker.java:282)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.OutOfMemoryError: Java heap space
[ERROR] 2025-02-06 00:10:50,546 [EpinionsWorker<009>] com.oltpbenchmark.ThreadBench uncaughtException - Self-suppression not permitted
java.lang.IllegalArgumentException: Self-suppression not permitted
at java.base/java.lang.Throwable.addSuppressed(Throwable.java:1096)
at com.oltpbenchmark.benchmarks.epinions.procedures.GetAverageRatingByTrustedUser.run(GetAverageRatingByTrustedUser.java:34)
at com.oltpbenchmark.benchmarks.epinions.EpinionsWorker.averageRatingByTrustedUser(EpinionsWorker.java:93)
at com.oltpbenchmark.benchmarks.epinions.EpinionsWorker.executeWork(EpinionsWorker.java:57)
at com.oltpbenchmark.api.Worker.doWork(Worker.java:434)
at com.oltpbenchmark.api.Worker.run(Worker.java:282)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.OutOfMemoryError: Java heap space
...
We are running the benchbase process with the following java arguments:
"-Xmx5g", # Maximum heap size
"-XX:+UseG1GC", # Use the Garbage-First (G1) Garbage Collector
"-XX:G1HeapRegionSize=4M", # Set G1 heap region size
"-XX:MaxGCPauseMillis=200", # Set maximum GC pause time
"-XX:ParallelGCThreads=4", # Set number of parallel GC threads
"-XX:+HeapDumpOnOutOfMemoryError", # Enable heap dump on OOM error
"-XX:HeapDumpPath=/tmp/heapdump" # Specify heap dump path
We are exploring the memory usage on the VM over time, will come back if we find anything more, but thought I'd post this meanwhile.