Hi Vladimir,
Class Name
| Ref. Objects | Shallow Heap | Ref. Shallow Heap |
Retained Heap
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
java.lang.Thread @ 0x6b42f7d0 cluster-390559 Native Stack, Thread
| 201.398 | 120 | 51.557.888 |
5.376
java.lang.Thread @ 0x6b42b878 cluster-390561 Native Stack, Thread
| 1 | 120 | 256 |
11.472
java.lang.Thread @ 0x6b41e218 cluster-390558 Native Stack, Thread
| 1 | 120 | 256 |
11.472
org.apache.ignite.thread.IgniteThread @ 0x6e8bb150
exchange-worker-#53%CLUSTER-ZWAY% Native Stack, Thread| 1 |
128 | 256 | 5.296
java.lang.Thread @ 0x6ca23cf0 FelixStartLevel Native Stack, Thread
| 1 | 120 | 256 |
58.872
java.lang.Thread @ 0x6b428e00 cluster-390564 Native Stack, Thread
| 1 | 120 | 256 |
11.472
java.lang.Thread @ 0x6b42d318 cluster-390560 Native Stack, Thread
| 1 | 120 | 256 |
11.568
java.lang.Thread @ 0x6b42b098 cluster-390562 Native Stack, Thread
| 1 | 120 | 256 |
11.472
java.lang.Thread @ 0x6d1cfd98 pool-193-thread-1 Native Stack, Thread
| 1 | 120 | 256 |
8.936
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And this the first first 51.557.888 “Thread”
Class Name
| Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
--------------------------------------------------------------------------------------------------------------------------------------------------------------
java.lang.Thread @ 0x6b42f7d0 cluster-390559 Native Stack, Thread
| 201.398 | 120 | 51.557.888 | 5.376
|- <Java Local> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing
@ 0x6e68b788| 201.395 | 88 | 51.557.120 | 1.271.608
| '- conns java.util.Collections$SynchronizedCollection @ 0x6ef32048
| 201.395 | 16 | 51.557.120 | 960.440
| '- c java.util.ArrayList @ 0x6eb87a68
| 201.395 | 24 | 51.557.120 | 960.424
| '- elementData java.lang.Object[240097] @ 0x68bca340
| 201.395 | 960.400 | 51.557.120 | 960.400
| |- [103850] org.h2.jdbc.JdbcConnection @ 0x65da3570
| 1 | 88 | 256 | 216
| |- [127859] org.h2.jdbc.JdbcConnection @ 0x6715cb38
| 1 | 88 | 256 | 216
| |- [79437] org.h2.jdbc.JdbcConnection @ 0x64a00068
| 1 | 88 | 256 | 216
| |- [151875] org.h2.jdbc.JdbcConnection @ 0x68512c10
| 1 | 88 | 256 | 216
| |- [175889] org.h2.jdbc.JdbcConnection @ 0x699abbc8
| 1 | 88 | 256 | 216
| |- [191914] org.h2.jdbc.JdbcConnection @ 0x6a6dbb40
| 1 | 88 | 256 | 216
| |- [199871] org.h2.jdbc.JdbcConnection @ 0x6b1767e8
| 1 | 88 | 256 | 216
| |- [95785] org.h2.jdbc.JdbcConnection @ 0x657167b0
| 1 | 88 | 256 | 216
| |- [127860] org.h2.jdbc.JdbcConnection @ 0x6715ce50
| 1 | 88 | 256 | 216
| |- [103851] org.h2.jdbc.JdbcConnection @ 0x65da3948
| 1 | 88 | 256 | 216
| |- [151876] org.h2.jdbc.JdbcConnection @ 0x68512f60
| 1 | 88 | 256 | 216
| |- [175890] org.h2.jdbc.JdbcConnection @ 0x699abee0
| 1 | 88 | 256 | 216
| |- [199872] org.h2.jdbc.JdbcConnection @ 0x6b176b38
| 1 | 88 | 256 | 216
| |- [95786] org.h2.jdbc.JdbcConnection @ 0x65716b38
| 1 | 88 | 256 | 216
| |- [127861] org.h2.jdbc.JdbcConnection @ 0x6715d1d8
| 1 | 88 | 256 | 216
| |- [79439] org.h2.jdbc.JdbcConnection @ 0x64a00738
| 1 | 88 | 256 | 216
| |- [151878] org.h2.jdbc.JdbcConnection @ 0x68513300
| 1 | 88 | 256 | 216
| |- [175892] org.h2.jdbc.JdbcConnection @ 0x699ac2a0
| 1 | 88 | 256 | 216
| |- [199875] org.h2.jdbc.JdbcConnection @ 0x6b176ed8
| 1 | 88 | 256 | 216
| |- [111861] org.h2.jdbc.JdbcConnection @ 0x66433448
| 1 | 88 | 256 | 216
| |- [74774] org.h2.jdbc.JdbcConnection @ 0x72e086b8
| 1 | 88 | 256 | 216
| |- [127862] org.h2.jdbc.JdbcConnection @ 0x6715d578
| 1 | 88 | 256 | 216
| |- [74778] org.h2.jdbc.JdbcConnection @ 0x72e08818
| 1 | 88 | 256 | 216
| |- [151877] org.h2.jdbc.JdbcConnection @ 0x68513618
| 1 | 88 | 256 | 216
| |- [79441] org.h2.jdbc.JdbcConnection @ 0x64a00ac0
| 1 | 88 | 256 | 216
| '- Total: 25 of 201.395 entries; 201.370 more
| | | |
|- <Java Local> org.h2.engine.Database @ 0x6f571a68
| 2 | 368 | 512 | 7.001.840
| |- systemSession org.h2.engine.Session @ 0x6f1d4060
| 1 | 256 | 256 | 472
| |- lobSession org.h2.engine.Session @ 0x6f1d4160
| 1 | 256 | 256 | 472
| '- Total: 2 entries
| | | |
|- <Java Local> org.h2.engine.Session @ 0x6b46dd28
| 1 | 256 | 256 | 472
'- Total: 3 entries
| | | |
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance
Devis Balsemin, FlexValley SRL (Italy) ,
Via Dante Alighieri 4, I-36075 Montecchio Maggiore, Italy | t: +39.0444.699622
| f: +39.0444.1830543
Please consider your environmental responsibility before printing this e-mail
This communication (including any attachments) may contain privileged or
confidential information of FlexValley SRL and is intended for a specific
individual. If you are not the intended recipient, you should delete this
communication, including any attachments without reading or saving them in any
manner, and you are hereby notified that any disclosure, copying, or
distribution of this communication, or the taking of any action based on it, is
strictly prohibited.
Da: Vladimir Ozerov [mailto:[email protected]]
Inviato: martedì 6 giugno 2017 15:02
A: [email protected]
Oggetto: Re: Memory Leak or my Error?
Hi Devis,
Can you show GC roots of these Session objects?
On Tue, Jun 6, 2017 at 3:52 PM, Devis Balsemin <[email protected]
<mailto:[email protected]> > wrote:
Hi,
I’m using Ignite 1.7.
I have a function nativeSQL that is called in many point of my programs.
But after 2/3days I receive my OOM (this function is called every 0.25ms X 10
concurrent users).
My dubmp show me
Class Name |
Objects | Shallow Heap | Retained Heap
----------------------------------------------------------------------------------------------------------------
org.h2.engine.Session |
201.406 | 51.559.936 | >= 95.063.648
char[] |
501.160 | 40.283.480 | >= 40.283.480
java.lang.Object[] |
625.053 | 21.469.296 | >= 34.984.640
org.h2.jdbc.JdbcConnection |
201.404 | 17.723.552 | >= 43.503.144
java.util.ArrayList |
616.718 | 14.801.232 | >= 38.616.296
java.util.HashMap$Node |
470.953 | 11.302.872 | >= 16.857.176
org.h2.engine.UndoLog |
201.406 | 9.667.488 | >= 32.224.960
org.apache.ignite.internal.util.GridCircularBuffer$Item |
343.040 | 8.232.960 | >= 8.232.968
java.lang.String |
500.219 | 8.003.504 | >= 47.308.152
org.h2.util.CloseWatcher |
201.404 | 6.444.928 | >= 13.375.872
java.util.HashMap$Node[] |
9.546 | 5.074.192 | >= 19.757.480
org.h2.message.Trace |
201.411 | 4.833.864 | >= 16.033.024
byte[] |
5.104 | 1.698.496 | >= 1.698.496
org.jsr166.ConcurrentHashMap8$Node[] |
85 | 1.531.792 | >= 2.455.608
org.apache.ignite.internal.util.GridCircularBuffer$Item[] |
4.216 | 1.439.616 | >= 9.672.576
org.apache.ignite.internal.processors.jobmetrics.GridJobMetricsSnapshot|
16.384 | 1.310.720 | >= 1.310.720
org.jsr166.ConcurrentLinkedHashMap$HashEntry[] |
1.308 | 1.225.408 | >= 1.225.472
Class Name | Objects | Shallow Heap
--------------------------------------------------------------
org.h2.engine.Session | 201.406 | 51.559.936
|- org.h2.jdbc.JdbcConnection | 201.404 | 17.723.552
|- org.h2.util.CloseWatcher | 201.404 | 6.444.928
|- java.util.HashMap$Node | 201.404 | 4.833.696
|- org.h2.command.dml.Select | 65 | 11.440
|- org.h2.table.TableFilter | 65 | 6.760
|- org.h2.jdbc.JdbcPreparedStatement | 65 | 5.720
|- org.h2.index.IndexCursor | 64 | 4.608
|- org.h2.command.CommandContainer | 65 | 2.600
|- org.h2.engine.Database | 1 | 368
|- java.lang.Thread | 1 | 120
|- org.jsr166.ConcurrentHashMap8$Node| 4 | 96
|- org.h2.result.LocalResult | 1 | 72
'- Total: 12 entries | |
Class Name
| Objects | Shallow Heap
-------------------------------------------------------------------------------------------------------------------
org.h2.jdbc.JdbcConnection
| 201.404 | 17.723.552
|- org.h2.util.CloseWatcher
| 201.404 | 6.444.928
|- java.lang.Object[]
| 1 | 960.400
|- org.h2.jdbc.JdbcPreparedStatement
| 65 | 5.720
|-
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$ConnectionWrapper
| 14 | 224
|- java.lang.Thread
| 1 | 120
|-
org.apache.ignite.internal.processors.query.h2.twostep.GridReduceQueryExecutor$QueryRun|
1 | 32
Class Name | Objects |
Shallow Heap
--------------------------------------------------------------------------------------------
java.util.ArrayList | 616.718 |
14.801.232
|- org.h2.engine.Session | 201.406 |
51.559.936
|- org.h2.engine.UndoLog | 201.406 |
9.667.488
|- org.apache.felix.framework.capabilityset.SimpleFilter | 5.798 |
139.152
|- org.apache.felix.framework.wiring.BundleCapabilityImpl | 1.777 |
71.080
|- java.lang.Object[] | 46 |
19.560
|- org.apache.felix.framework.BundleRevisionImpl | 221 |
17.680
|- org.apache.felix.framework.BundleImpl | 221 |
14.144
|- java.util.HashMap$Node | 514 |
12.336
|- org.h2.command.dml.Select | 65 |
11.440
|- com.flexvalley.drivers.zway.internal.config.ZWaveDbProduct | 340 |
8.160
|- java.security.Provider$Service | 126 |
7.056
|- java.util.concurrent.ConcurrentHashMap$Node | 292 |
7.008
|- org.h2.table.TableFilter | 65 |
6.760
|- org.apache.cxf.bus.osgi.CXFExtensionBundleListener$OSGiExtension| 106 |
5.936
|- org.apache.xerces.dom.AttributeMap | 167 |
4.008
--------------------------------------------------------------------------------------------
H2 is used only by Ignite.
This is only one function that runs QueryCursor.
@Override
public List<V> nativeSQL(final Class<?> cls, final String whereCondition, final
Object... whereParams) {
StringBuilder sqlText=new StringBuilder("select * from
").append(cls.getSimpleName()).append(" where ").append(whereCondition);
try(QueryCursor<List<?>> qryx = cache
.query(new SqlFieldsQuery(sqlText.toString())
.setArgs(whereParams))) {
List<V> list = new CopyOnWriteArrayList<>();
iteratorToStream(qryx.iterator(),true).parallel().forEach(objects -> {
list.add((V) objects.get(1));
});
//qryx.close();
return list;
} catch (Exception ex) {
logger.error("Query Error {}", ex);
}
finally {
sqlText.setLength(0);
sqlText=null;
}
return null;
}
Can you help me understand if it’s my mistake please?
Best Regards
Devis Balsemin, FlexValley SRL (Italy) ,
Via Dante Alighieri 4, I-36075 Montecchio Maggiore, Italy | t: +39.0444.699622
| f: +39.0444.1830543
Please consider your environmental responsibility before printing this e-mail
This communication (including any attachments) may contain privileged or
confidential information of FlexValley SRL and is intended for a specific
individual. If you are not the intended recipient, you should delete this
communication, including any attachments without reading or saving them in any
manner, and you are hereby notified that any disclosure, copying, or
distribution of this communication, or the taking of any action based on it, is
strictly prohibited.