You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Jonathan Leech (JIRA)" <ji...@apache.org> on 2016/12/05 19:43:58 UTC

[jira] [Commented] (PHOENIX-3518) Memory Leak in RenewLeaseTask

    [ https://issues.apache.org/jira/browse/PHOENIX-3518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15723176#comment-15723176 ] 

Jonathan Leech commented on PHOENIX-3518:
-----------------------------------------

From Eclipse memory analysis tool
Class Name                                                                                                      | Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------------
java.lang.ref.WeakReference @ 0x7378442d0                                                                       |           32 |             0
'- item java.util.concurrent.LinkedBlockingQueue$Node @ 0x7378442f0                                             |           24 |             0
   '- last java.util.concurrent.LinkedBlockingQueue @ 0x5cc884f00                                               |           48 |             0
      '- connectionsQueue org.apache.phoenix.query.ConnectionQueryServicesImpl$RenewLeaseTask @ 0x5cd8870e8     |           24 |             0
         '- task java.util.concurrent.Executors$RunnableAdapter @ 0x5cd8870d0                                   |           24 |             0
            '- callable java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask @ 0x5cd887088      |           72 |             0
               '- [8] java.util.concurrent.RunnableScheduledFuture[16] @ 0x5cd886d78                            |           80 |             0
                  '- queue java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue @ 0x5cd886d58      |           32 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd8874d8  PHOENIX-SCANNER-RENEW-LEASE-thread-9 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd8877f8  PHOENIX-SCANNER-RENEW-LEASE-thread-3 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd887b10  PHOENIX-SCANNER-RENEW-LEASE-thread-4 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd887e28  PHOENIX-SCANNER-RENEW-LEASE-thread-0 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd888140  PHOENIX-SCANNER-RENEW-LEASE-thread-5 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd890380  PHOENIX-SCANNER-RENEW-LEASE-thread-1 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd890698  PHOENIX-SCANNER-RENEW-LEASE-thread-7 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd890948  PHOENIX-SCANNER-RENEW-LEASE-thread-8 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd890bf8  PHOENIX-SCANNER-RENEW-LEASE-thread-6 Thread|          120 |             0
                     |- <Java Local> java.lang.Thread @ 0x5cd890f10  PHOENIX-SCANNER-RENEW-LEASE-thread-2 Thread|          120 |             0
                     |- workQueue java.util.concurrent.ScheduledThreadPoolExecutor @ 0x5cd886cf8                |           80 |             0
                     '- Total: 11 entries                                                                       |              |              
-----------------------------------------------------------------------------------------------------------------------------------------------

From jmap -histo:live
num     #instances         #bytes  class name
----------------------------------------------
   1:     100167888     3205372416  java.lang.ref.WeakReference
   2:     100166733     2404001592  java.util.concurrent.LinkedBlockingQueue$Node
...

From jmap -heap
PS Old Generation
   capacity = 5595201536 (5336.0MB)
   used     = 5594874240 (5335.6878662109375MB)
   free     = 327296 (0.3121337890625MB)
   99.99415041624695% used



> Memory Leak in RenewLeaseTask
> -----------------------------
>
>                 Key: PHOENIX-3518
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3518
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>         Environment: 5.7.1-1.cdh5.7.1.p0.11 + jdk1.7.0_67
> 4.7.0-1.clabs_phoenix1.3.0.p0.000
> CentOS Linux release 7.0.1406 (Core)
> apache-tomcat-8.5.4 + jdk1.8.0_102 
>            Reporter: Jonathan Leech
>
> Looks like PHOENIX-2357 introduced a memory leak, at least for me... I end up with old gen filled up with objects - 100,000,000 instances each of WeakReference and LinkedBlockingQueue$Node, owned by ConnectionQueryServicesImpl.connectionsQueue. The PhoenixConnection referred to by the  WeakReference is null for all but the few active connections. I don't see anything in the log - I can't confirm that it's logging properly though. Per the docs for ScheduledThreadPoolExecutor, if the run method throws an error, further executions are suppressed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)