activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <>
Subject Re: problem about forwarding bridge from VM to remote host
Date Fri, 08 Nov 2013 15:03:43 GMT

On Fri, Nov 8, 2013 at 1:05 AM, smith_jor <> wrote:
> There is an embedded broker inside application, application sends messages to
> this vm ,and vm forwards messages to remote broker A. there is  a consumer
> receiving messages on remote broker A using asyn mode.
> the configure uri like this -
> "vm:(broker:(network:static:(tcp://remotehostA:61616))?persistent=false)"
> Since the speed that application send messages to VM is faster than VM
> forwarding messages to remote host.
> So there are many messages stored in VM waiting for forwarding to
> remotehostA, and the memory occupied by application becomes larger and
> larger.
> this can make application out of memory , right?
Are you sending persistent messages? If the broker exhausts its
defined memory usage (see defaults here: then messages
will just be sent to disk. You can configure all of these values
(store size, disk size, producer flow control, etc). If your settings
are correct, you should never OOM even if your remote consumer is
slower than the local producer.

> Also ,when appliction stop sending messages, and VM forward all the messages
> to remote host A , the memory occupied by application does not decrease.
> this confumes me a lot.
> It seems more reasonable that VM should release the memory , since VM
> already forwards all the messages to remote host. right ?
Well, GC by the JVM is not very deterministic in most cases. You
should take a memory snapshot and trace live objects vs just what you
see as the JVM heap usage... you can even force a GC using jconsole or
visualvm to get closer to what the live object usage is.. if that
doesn't drop, then take a memory snapshot and figure out what the heap
consists of. if there are uncollected objects that should have been
collected, then start analyzing why and how they're leaked.

> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at

Christian Posta
twitter: @christianposta

View raw message