-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TupleIterator from Java_karmaresearch_vlog_VLog_query is not proper deleted #94
Comments
Hi, |
CerielJacobs
added a commit
that referenced
this issue
Jan 25, 2022
Sorry, I use the following rule:
Yes, getEDBIterator() gets called:
Your commit reduced the memory leak after the first minute to 4 GB. |
CerielJacobs
added a commit
that referenced
this issue
Jan 26, 2022
Hi, |
Hi, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
when I call the method VLogReasoner.getInferences() from Rulewerk in Java multiple times, then the needed memory of the process increases continuously.
This happens independently of the used knowledge base as long as the knowledge base is not empty and the reasoner has to reason.
This happens even when the loop consists just of the call of the method getInferences(). And the rest of the calls can be done outside of the loop.
s.csv:
The example from the top uses after a minute almost 20 GB of RAM.
Searching for a Java memory leak, I profiled the Java heap with the JProfiler.
But the indicated memory in JProfiler differed from the number of my taskmanager.
This difference increased with every second. After 40 s the JProfiler shows 4 GB of reserved memory, but my taskmanager told me the process used ~15 GB.
After starting the GarbageCollector manually, most of the 4 GB from the JProfiler were freed, which the taskmanager confirmed.
After that the used memory, shown in the taskmanager, was ~11 GB and still increasing.
An analysis with the run option "-verbose:gc" confirmed the numbers of the JProfiler.
From this I concluded that there is a memory leak outside of Java and tried to analyse the whole used memory of the method.
I analysed the method with the tool Heaptrack, which indicated a memory leak in libvlog-core.so.
The size of this memory leak was 16GB, which equals the difference between the indicated memory of JProfiler and my taskmanager.
After that I print debugged the method Java_karmaresearch_vlog_QueryResultIterator_cleanup in src/vlog/native/Vlog.cpp, the destructors of the TupleIterator and the TupleTableItr:
This confirms that every created Iterator will be destroyed.
The suspicion was, that the memory leak is introduced by the TupleTableItr class.
To double check we replaced it by a dummy implementation DummyItr and use it in the function Java_karmaresearch_vlog_VLog_query.
In this case we do not observe any memory leak. The memory usage remains constant during the whole execution time.
This substantiates the earlier suspicion.
The text was updated successfully, but these errors were encountered: