You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Patrick Twohig (JIRA)" <ji...@apache.org> on 2012/11/02 07:38:12 UTC

[jira] [Created] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Patrick Twohig created VYSPER-332:
-------------------------------------

             Summary: Memory Leak in BoshBackedSessionContext
                 Key: VYSPER-332
                 URL: https://issues.apache.org/jira/browse/VYSPER-332
             Project: VYSPER
          Issue Type: Bug
          Components: BOSH
    Affects Versions: 0.7
         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
 - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
 - Jetty 6.1.24

            Reporter: Patrick Twohig


I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the BoshBackedServletSessionContext consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of BoshBackedServletSessionContext.  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "wan jian ming (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13501720#comment-13501720 ] 

wan jian ming commented on VYSPER-332:
--------------------------------------

maybe this is the same problem as VYSPER-328 infinite loop. I came across this.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495994#comment-13495994 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

Note the "[pool-5-thread-{n}]" in the log file. These denotes a thread from the thread pool for handling and queuing the presences.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495990#comment-13495990 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

How do you interpret this?
My take is that it seems like a rouge client swamps the server with Presence messages in extremely short intervals. 
Vysper only has so much bandwith to deal with it. You'd need to enlarge internal buffers to be able to cope with that.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489983#comment-13489983 ] 

Emmanuel Lecharny commented on VYSPER-332:
------------------------------------------

It *could* happen if the client does not read the messages fast enough: MINA stacks all the messages in a list and wait until the client's socket is ready for OP_WRITE. In some cases, I have seen this list growing and growing up to a point we get an OOM.

Bottom line: the Handler should check that the list is not too big before writting some new messages using the session.getWriteRequestQueue().size() method.

Now, this is a problem I faced in another MINA based application, not sure it applies to Vysper.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489978#comment-13489978 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

I think handling 700K messages with 350 MB RAM doesn't sound too bad. Roughly, each msg only consumes 500 byte in average. :-)
The question is: Why is this lot of msg piling up? Why isn't it delivered? Who generates this many msgs? 
So, I'd need some test case or more information to investigate further.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489520#comment-13489520 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

I'll give Trunk a try for sure.  My big question is, why isn't that queue bounded?  I would assume once you get to a certain number of messages waiting to be sent, it should just assume the user has gone away and isn't eligible for incoming messages.  I have a sneaking suspicion what's happening in my situation is we have a buggy client that's flooding the server.  Correct me if I'm wrong, but a single user shouldn't expect to get more than maybe ~100 messages queued up.  Why not also drop the session when the user hits some limit?
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Twohig updated VYSPER-332:
----------------------------------

    Description: I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.  (was: I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the BoshBackedServletSessionContext consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of BoshBackedServletSessionContext.  I can provide a heap dump if needs be.)
    
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489305#comment-13489305 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

BOSH has been heavily reworked in TRUNK. It's already used in production.
Please try again with TRUNK.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495995#comment-13495995 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

I found this in the AbstractSessionContext class: 

                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496008#comment-13496008 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

I found a comment in the AbstractSessionContext class indicating that the resource the resource registry doesn't handle the situation where a client "goes berserk" and could cause a DoS attack.  Would that be related?

I also noticed in the BoshHandler that the BoshBackedSessionContext writes a stanza before finally closing it.  I was curious if maybe that write before closing was inadvertently keeping the session along for much longer than intended.  I traced through the code as best I could, but wasn't able to make sense of it.  My suspicion was that a session is lingering around unable to deliver messages to a client they just keep stacking up.  Thought the inactivity checker will purge them it seems like it may take longer than expected.  Is that a possibility?

At what point does the BoshBackedSessionContext actually get placed in the registry?
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495931#comment-13495931 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

I just was able to get it to happen with the trunk branch.  It's strange that it idnd't happen until I had toggled between connecting the same user in short order.  I connected one user using BOSH, disconnected, and then re-connected the user again using BOSH.  I don't know if it was a "clean" disconnect or not.  I'm wondering if this has something to do with mixing connection types.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489655#comment-13489655 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

If the client is gone, his session will time out eventually and the SessionContext should be collected, freeing all memory. Maybe you are running in some bug we don't know yet. 
What kind of OOME are you seeing? Is your old generation really filled up or are you experiencing OOME in young/tenure generation?
300 MB of heap is not that much nowadays. Are you in a resource-limited environmen? How many messages are in the qeue? (I presume its sentResponses?) What is the average message size?
I agree that there should be the option to configure an upper limit, but an assumption like (100 msg should be enough) only arbitrarily limits throughput. 
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Twohig updated VYSPER-332:
----------------------------------

    Attachment: log_tail.txt

Here's the anonymized log file showing what's happening while the server is unresponsive.  I can't even get it to produce a thread dump using kill -3 so something is typing up all the VMs resources.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495931#comment-13495931 ] 

Patrick Twohig edited comment on VYSPER-332 at 11/13/12 4:29 AM:
-----------------------------------------------------------------

I just was able to get it to happen with the trunk branch.  It's strange that it idnd't happen until I had toggled between connecting the same user in short order.  I connected one user using BOSH, disconnected, and then re-connected the user again using BOSH.  I don't know if it was a "clean" disconnect or not.  I'm wondering if this has something to do with mixing connection types.

Also, I'm no longer running in Jetty 6, I moved it over to Jetty 8.  In this case the BOSH endpoint is running in the same VM as my web service and I have the BOSH endpoint actually configured in my web.xml.  Not sure if this makes a difference.
                
      was (Author: patrickt):
    I just was able to get it to happen with the trunk branch.  It's strange that it idnd't happen until I had toggled between connecting the same user in short order.  I connected one user using BOSH, disconnected, and then re-connected the user again using BOSH.  I don't know if it was a "clean" disconnect or not.  I'm wondering if this has something to do with mixing connection types.
                  
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489700#comment-13489700 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

True, I didn't give the server a whole lot of memory.  It's a dev server running a micro instance in EC2.  I gave the VM 350 megabytes or ram or so.  However, the heap dump I have shows that the BoshBackedSessionContext contains a LinkedList referencing 700,000 entries.  Additionally, I know only about a dozen people (QA staff) are using the server.
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Bernd Fondermann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490159#comment-13490159 ] 

Bernd Fondermann commented on VYSPER-332:
-----------------------------------------

Thanks Emmanuel, interesting.
In BoshBackedSessionContext we are completely not in MINA-land, so I'm pretty sure it doesn't apply here.

The original poster needs to check where this unexpectedly high number of messages comes from and how the target session behaves (if it has any pending long-polling requests).
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496009#comment-13496009 ] 

Patrick Twohig commented on VYSPER-332:
---------------------------------------

Also, even if the server is hit with a "rogue client"  it should cut off the rogue client before it causes a crash.  I dunno that the whole server should die.  Where would be a good place to drop in some sort of rate-limiter?
                
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VYSPER-332) Memory Leak in BoshBackedSessionContext

Posted by "Patrick Twohig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VYSPER-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Twohig updated VYSPER-332:
----------------------------------

    Comment: was deleted

(was: I found this in the AbstractSessionContext class: 
)
    
> Memory Leak in BoshBackedSessionContext
> ---------------------------------------
>
>                 Key: VYSPER-332
>                 URL: https://issues.apache.org/jira/browse/VYSPER-332
>             Project: VYSPER
>          Issue Type: Bug
>          Components: BOSH
>    Affects Versions: 0.7
>         Environment:  - Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-31-virtual x86_64)
>  - OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
>  - Jetty 6.1.24
>            Reporter: Patrick Twohig
>         Attachments: log_tail.txt
>
>
> I'm seeing the heap size grow disproportionately large when running the BoshServlet in my web application.  Specifically, I am seeing the  consume 300+ megabytes of heap causing an OOME.  The heap dump indicates that roughly 85% of my memory is consumed but the single instanced of .  I can provide a heap dump if needs be.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira