kevoree-modeling / mwDB

Many-World Database repository
Apache License 2.0
11 stars 2 forks source link

Small memory leak on Polynomial read #12

Closed lmouline closed 8 years ago

lmouline commented 8 years ago

There is a small memory leak with KDTree :) Bench result:

# JMH 1.13 (released 9 days ago)
# VM version: JDK 1.8.0_66, VM 25.66-b17
# VM invoker: /opt/jdk/jdk1.8.0_66/jre/bin/java
# VM options: <none>
# Warmup: <none>
# Measurement: 1 iterations, single-shot each, 1000000 calls per op
# Timeout: 5 min per iteration
# Threads: 1 thread
# Benchmark mode: Single shot invocation time
# Benchmark: org.kevoree.mwg.benchmark.ml.PolynomialRead.benchPolynomial
# Parameters: (cacheSize = 5000000, useHeap = true)

Forking using command: [/opt/jdk/jdk1.8.0_66/jre/bin/java, -XX:CompileCommandFile=/tmp/jmh98844555278615798compilecommand, -cp, bench/target/mwg-benchmark.jar, org.openjdk.jmh.runner.ForkedMain, 127.0.0.1, 41184]
# Run progress: 0.00% complete, ETA 00:00:00
# Fork: 1 of 100
Iteration   1: Aug 01, 2016 8:39:48 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
Aug 01, 2016 8:39:48 AM com.github.fommil.netlib.BLAS <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
Aug 01, 2016 8:39:48 AM com.github.fommil.netlib.LAPACK <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeSystemLAPACK
Aug 01, 2016 8:39:48 AM com.github.fommil.netlib.LAPACK <clinit>
WARNING: Failed to load implementation from: com.github.fommil.netlib.NativeRefLAPACK
<failure>

java.lang.RuntimeException: Memory leak detected: startAvailableSpace=4999996; endAvailableSpace=4999994; diff= 2

It appears in heap and off heap memory, but only on build server (Debian 8.5/docker).

I created a small Jenkins build to reproduce it.

assaad commented 8 years ago

Tracked down the bug, it is happening when i create a new phased state. Will check with Francois

dukeboard commented 8 years ago

Yep you're right the new implementation of NewState has a problem while caching previous result. I will have a look

dukeboard commented 8 years ago

fixed in commit 59895b562b9e43368e89c7a9d8d1d9e81f6c305c