I'm using the connection pool from java against Stardog. When using the pool Stardog will eventually run out of memory. Switching to creating and closing connections for each query fixes this.
Here is how Stardog looks when running out of memory:
The small white sections are when stardog is unresponsive because of GC. The light green, dark green beginning of the memory is how stardog usually runs, only minor GC.
I've been debugging to see if I'm forgetting to close something against stardog, but I can't see that anything is left open.
I used reflection to get hold of all the variables inside the connection, and also the size of the pool.
This is from one the services that is causing Stardog to run out of memory. As you can see there is no transaction left open and all query results are closed. Pool size is 0, because this connection hasn't been returned to the pool yet.
How do I proceed to debug stardog to find out why the connection is taking more and more memory in Stardog?
Sorry for the delay, but have you tried this with the 5.0 beta? If it’s still not good there, can you check to make sure you aren’t leaving something like TupleQueryResult open? We have a few classes that extend AutoCloseable that you might want to use try-with-resources on just to ensure they don’t ever remain unclosed.
Trying this on 5.0 beta today. The web ui isn’t showing any memory info. I can see that there are some new fields in the memory info from the server, but they are not shown. Also it seems that the heap usage is always 0 mb, which seems strange.
That’s great to hear! Apologies for your problems with some of the graphical components of the web console. Everything front-end is a bit in flux at the moment with 5.0
Hello,
I'm creating connections using try-with-resources, but I'm having the following issue:
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
at java.base/java.lang.Thread.start0(Native Method)
at java.base/java.lang.Thread.start(Thread.java:798)
at org.apache.http.impl.client.IdleConnectionEvictor.start(IdleConnectionEvictor.java:96)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:1238)
at com.complexible.stardog.protocols.http.client.BaseHttpClient.<init>(BaseHttpClient.java:194)
at com.complexible.stardog.protocols.http.client.BaseHttpClient.<init>(BaseHttpClient.java:207)
at com.complexible.stardog.protocols.http.client.HttpClientImpl.<init>(HttpClientImpl.java:147)
at com.complexible.stardog.protocols.http.client.HttpConnection.create(HttpConnection.java:106)
at com.complexible.stardog.protocols.http.client.HttpDriver.connect(HttpDriver.java:84)
at com.complexible.stardog.api.DriverManager.getConnection(DriverManager.java:90)
at com.complexible.stardog.api.ConnectionConfiguration.connect(ConnectionConfiguration.java:204)
at com.complexible.stardog.api.ConnectionPoolableObjectFactory.makeObject(ConnectionPoolableObjectFactory.java:30)
at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1691)
at org.apache.commons.pool.PoolUtils.prefill(PoolUtils.java:315)
at com.complexible.common.pool.ApachePoolImpl.<init>(ApachePoolImpl.java:36)
at com.complexible.stardog.api.ConnectionPoolConfig$ApacheConnectionPool.<init>(ConnectionPoolConfig.java:120)
at com.complexible.stardog.api.ConnectionPoolConfig.create(ConnectionPoolConfig.java:113)
at com.complexible.stardog.rdf4j.StardogRepository.initializeInternal(StardogRepository.java:115)
at org.eclipse.rdf4j.repository.base.AbstractRepository.init(AbstractRepository.java:39)
at org.eclipse.rdf4j.repository.base.AbstractRepository.initialize(AbstractRepository.java:31)
at com.complexible.stardog.rdf4j.StardogRepository.<init>(StardogRepository.java:57)