ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tysli2016 <Tom.YS...@cityline.com.hk>
Subject Re: Ignite 1.6.0 suspected memory leak from DynamicCacheDescriptor
Date Fri, 16 Dec 2016 02:53:22 GMT
ic, so the embedded instance is the IgniteKernal object which implement the
Ignite interface.

> So these are instances are not really used by Ignite, but are saved
> somewhere, most likely in your code. Can you use heap dump to trace it? 

Yes, there are a whole lot of CacheConfiguration objects created, but it's
not from my code.
Frankly I think Ignite is having a very well designed API with with I don't
have to code much to use it, and I don't have a good reason to create
CacheConfiguration objects. What my code do is call Ignition.start() with a
IgniteConfiguration object like this:

	IgniteConfiguration configuration = new IgniteConfiguration();
	configuration.setGridLogger(new Slf4jLogger());
	configuration.setDiscoverySpi(discoverySpi);
	configuration.setCommunicationSpi(commumicationSpi);

	Ignition.setClientMode(true);
	Ignite ignite = Ignition.start(configuration);	


And what I found from the heap dump is those CacheConfiguration objects are
not saved "somewhere", but in a java.util.HashMap @ 0x8423c790, which is
ultimately held by a GridKernalContextImpl:

    Class Name                                                                           
                                                                           
| Shallow Heap | Retained Heap 
   
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                                                                                         
                                                                           
|              |               
    java.util.HashMap$Node[65536] @ 0xcd657f20                                           
                                                                           
|      262,160 |   227,306,744 
    '- table java.util.HashMap @ 0x8423c790                                              
                                                                           
|           48 |   227,306,792 
       '- rmtCfgs
org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor @
0x81a78dc8                                                                    
|           56 |   227,306,848 
          '- value java.util.HashMap$Node @ 0xe066c018                                   
                                                                           
|           32 |            32 
             '- [11] java.util.HashMap$Node[16] @ 0xe066bf48                             
                                                                           
|           80 |           272 
                '- table java.util.HashMap @ 0xe066bf08                                  
                                                                           
|           48 |           320 
                   '- cachesOnDisconnect
org.apache.ignite.internal.processors.cache.GridCacheProcessor @ 0x81bacb08              
                                  
|           80 |         2,640 
                      '- cacheProc
org.apache.ignite.internal.GridKernalContextImpl @ 0x818f6900                            
                                        
|          248 |     1,596,328 
                         |- ctx org.apache.ignite.internal.IgniteKernal @
0x818f68a0                                                                               
 
|           96 |           200 
                         |  |- ignite
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi @ 0x819c19c0                 
                                     
|          240 |         2,000 
                         |  |  |- this$0
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$CommunicationWorker
@ 0x81b97128  tcp-comm-worker-#1%null% Thread|          144 |         2,640 
                         |  |  |- this$0
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi$3 @ 0x81b97098               
                                  
|           16 |            16 
                         |  |  '- Total: 2 entries                                       
                                                                           
|              |               
                         |  |- ignite
org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi @ 0x81968500                         
                                     
|          256 |       104,176 
                         |  |- grid
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance @ 0x81967d28                   
                                       
|           88 |           344 
                         |  '- Total: 3 entries                                          
                                                                           
|              |               
                         |- ctx
org.apache.ignite.internal.processors.clock.GridClockServer @ 0x819680e0                 
                                           
|           32 |            32 
                         |- ctx
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager @
0x81968468                                                       |         
128 |        45,944 
                         |- ctx
org.apache.ignite.internal.processors.timeout.GridTimeoutProcessor @
0x81b97c98                                                       |          
32 |           512 
                         |- ctx
org.apache.ignite.internal.processors.rest.GridRestProcessor @ 0x81bad1a0                
                                           
|           64 |         1,056 
                         |- ctx
org.apache.ignite.internal.processors.datastreamer.DataStreamProcessor @
0x83009a50                                                   |           48
|         2,008 
                         |- ctx
org.apache.ignite.internal.managers.deployment.GridDeploymentManager @
0x818f69f8                                                     |          
48 |         2,496 
                         '- Total: 7 entries                                             
                                                                           
|              |               
   
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



> May be you somehow start and stop your caches periodically?
No, and I don't have a good reason to do so. The Ignite object once created
from Ignition.start() is able to (re)connect to servers in the cluster in
case of temporary disconnection. So my code only create one Ignite object
from Ignition.start() once, and only call Ignite.close() when the
application server is about to stop.

And just out of curiosity, what if one actually did start and stop caches
periodically? If they are legitimate operations then should not lead to
memory leak.

Tom



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-1-6-0-suspected-memory-leak-from-DynamicCacheDescriptor-tp9443p9582.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message