[Red5] jmap -histo:live ... is that normal? :-o

SeTyR setyr at free.fr
Sat Apr 5 06:57:06 PST 2008


Thanks Thomas for your test source code;
I'm running 0.6.3, however i have a simple question :) :

jmap usage : what should i type in to check all this in my server console ?

Typing  " jmap localhost histo:live "
i get :
Error attaching to remote server: java.rmi.ConnectException: Connection 
refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused

Whats the correct syntax ? Sorry for that but im still not at ease with many 
commands and unix usage

SeTyR

----- Original Message ----- 
From: "Thomas Auge" <auge at virtues.net>
To: <red5 at osflash.org>
Sent: Saturday, April 05, 2008 4:37 PM
Subject: Re: [Red5] jmap -histo:live ... is that normal? :-o


>> OK. I create my own here and see I can reproduce it. How many times are
>> appropriate to make it big?
>
> It grows roughly 15k per connection. So after 100 connections you'll see
>   1-2MB going missing in the tenured generation. After 1000 it becomes
> painfully obvious that it's not just buffer saved for later. ;)
>
> If you are using the flash authoring tool and want to save 30 seconds,
> create a fresh flash app and ...
>
> 1. Copy/paste this code into Scene 1:Layer 1:Frame 1 actions:
> -----------------
>
> var server = "rtmp://your.server/yourApp";
> var conn = new NetConnection();
> conn.setId = null;
>
> var stopit = 0;
> var count = 0;
>
> connect();
>
> function connect()
> {
> conn.onStatus = function(info) {
> trace("Chat NS Status\n--------------\nLevel: "+info.level+" | Code:
> "+info.code+"\n");
> if (info.code == "NetConnection.Connect.Success") {
> conn.close();
> count++;
> statuslabel.text = "Turn "+count;
> if (stopit == 0) setTimeout(connect, 50);
> }
> else if (info.code == "NetConnection.Connect.Failed") {
> statuslabel.text = "Failed at "+count;
> }
> }
>
> conn.connect(server, getTimer());
> }
> ---------------------------------
>
>
> 2. Create a dynamic text field and name it "statuslabel".
>
>
> [OPTIONAL]
> 3. Create the stop button with the following code:
> --------------
> on (click) {
> _root.stopit = 1;
> }
> -------------
>
>
>
>
>>
>>>
>>>
>>>> On Sat, Apr 5, 2008 at 9:48 PM, Thomas Auge <auge at virtues.net> wrote:
>>>>
>>>>>> any ideas how to check this, i think the cpu thing is the gc going
>>>>>> crazy, does it ramp up and down ? We need to somehow come up with the
>>>>>> best java configure line to run red5 in I guess ?
>>>>> Yes, what you are seeing is most likely the garbage collection. Since
>>> it
>>>>> seems that 0.7 is really leaking memory, all this spills over into the
>>>>> tenured generation, which requires a much more complex GC than the
>>> young
>>>>> generations. In an ideal world stuff in the tenured generation should
>>> be
>>>>> long lived and rarely collected. However, java runs a GC every time a
>>>>> heap type reaches 100% (or in a certain interval, which is much
>>> higher).
>>>>> Once you have hit your memory barrier and the heap cannot expand,
>>> you'll
>>>>> be running A LOT of GCs, in your case through A LOT of memory.
>>>>>
>>>>> Unless there is something in 0.7 you need, I'd suggest downgrading to
>>>>> 0.6.2 (maybe 0.6.3 too, but I tested with 0.6.2, since I had that
>>> idling
>>>>> around as a leftover. ;)
>>>>>
>>>>> 0.6.2 ran on my live machines with up to 600 concurrent connections
>>> with
>>>>> 512MB max allowed memory without a single restart in half a year. I'd
>>>>> say it can be considered stable. ;)
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>>> On 05/04/2008, at 10:28 AM, Thomas Auge wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am having some memory issues with red5. Basically over time it 
>>>>>>> uses
>>>>>>> all available memory. Most of it ends up in the tenured generation.
>>>>>>> Funny enough, it's not related to clients. When the server starts
>>>>>>> up, it
>>>>>>> supports over 300 clients with only 100MB of ram. But it keeps
>>>>>>> growing.
>>>>>>> When it hits the limit of memory it's allowed to take, garbage
>>>>>>> collection runs wild, which is quite obvious from the CPU load.
>>>>>>>
>>>>>>> The funny thing is, when I check histo:live, I see this:
>>>>>>>
>>>>>>>  num     #instances         #bytes  class name
>>>>>>> ----------------------------------------------
>>>>>>>    1:         16876        8385376  [B
>>>>>>>    2:        157904        5052928
>>>>>>> java.util.concurrent.ConcurrentHashMap$Segment
>>>>>>>    3:        162252        3894048
>>>>>>> java.util.concurrent.locks.ReentrantLock$NonfairSync
>>>>>>>    4:         54184        3707544  [C
>>>>>>>    5:         26950        3079704  <constMethodKlass>
>>>>>>>    6:        157904        2601128
>>>>>>> [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
>>>>>>>    7:          9744        2473720  [I
>>>>>>>    8:         26950        2156728  <methodKlass>
>>>>>>>    9:         36112        1577920  <symbolKlass>
>>>>>>>   10:         18779        1550528  [Ljava.util.HashMap$Entry;
>>>>>>>   11:          2790        1416824  <constantPoolKlass>
>>>>>>>   12:         56729        1361496  java.lang.String
>>>>>>>   13:          2790        1182248  <instanceKlassKlass>
>>>>>>>   14:         38774         930576  java.util.HashMap$Entry
>>>>>>>   15:          2545         872656  <constantPoolCacheKlass>
>>>>>>>   16:          9869         789520
>>>>>>> [Ljava.util.concurrent.ConcurrentHashMap$Segment;
>>>>>>>   17:         16820         672800  java.util.HashMap
>>>>>>>   18:          1804         404096
>>>>>>> org.red5.server.net.rtmp.RTMPMinaConnection
>>>>>>>   19:          9869         394760
>>>>>>> java.util.concurrent.ConcurrentHashMap
>>>>>>>   20:          1804         375232
>>>>>>> org.apache.mina.transport.socket.nio.SocketSessionImpl
>>>>>>>   21:         11750         365752  [Ljava.lang.Object;
>>>>>>>   22:         10001         320032
>>>>>>> org.apache.commons.collections.map.AbstractLinkedMap$LinkEntry
>>>>>>>   23:          3085         296160  java.lang.Class
>>>>>>>   24:          3595         220616  [S
>>>>>>>   25:          1813         217560  java.net.SocksSocketImpl
>>>>>>>   26:          8540         204960  javax.management.ObjectName
>>>>>>> $Property
>>>>>>>   27:          1804         187616  sun.nio.ch.SocketChannelImpl
>>>>>>>   28:          4467         185000  [[I
>>>>>>>   29:          7223         173352  java.net.InetSocketAddress
>>>>>>> ...
>>>>>>>
>>>>>>>
>>>>>>> That looks unealthy in a way. Any ideas what could cause such a
>>>>>>> garbled
>>>>>>> output?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Thomas
>>>>>>>
>>>>>>> P.S.: I am using the latest trunk.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Red5 mailing list
>>>>>>> Red5 at osflash.org
>>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>> _______________________________________________
>>>>>> Red5 mailing list
>>>>>> Red5 at osflash.org
>>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>>
>>>>> _______________________________________________
>>>>> Red5 mailing list
>>>>> Red5 at osflash.org
>>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
> 




More information about the Red5 mailing list