/Steffen,
The best way to ensure good performance when handling this size of
messages, is by trying to work with StreamSources as much as you can.
This avoids loading the entire XML structure into memory at once. Could
you post us an example of what your beans are doing? If they don't need
access to the message content, you can just pass along the StreamSource
object without touching it. You can only read a message on time off a
StreamSource, so you'll need to convert it a re-readable source type if
you want to access it multiple times. Be aware that this also happens
when you set the logging level to DEBUG in ServiceMix (because the
message content needs to appear in the log).
Perhaps the memory is eligible for garbage collection, but just hasn't
been freed yet. Does the memory on the heap stay allocated when you
explicitly start the garbage collector from JConsole? If if does, we
should be looking for a place where the message is cached or (more
commonly) a mistake in the MEP handling (e.g. a DONE message that is
missing so ServiceMix has to keep the MessageExchange in memory).
Regards,
Gert
steff aka sid wrote:
Hi,
I've got an performance issue. I have serveral beans which have to process
messages where the xml files are about 50+ MByte. Currently I'am working
with consumer bean instances which have an DeliveryChannel and
ServiceMixClient object. My problem is, that when I process one message/file
after that there where 300Mbytes staying in heap. So I did some performance
tests with netbeans and saw that there where much byte[] and char[] objects
(Not totally shure from where they come). After starting SMX without doing
anything my heap is about 20MByte. So I think there must be some failure in
my code. So I searched all created classes found some failures but the
problem doesn't disappear.
Then I found out that it is possible to call the close()-Method of the
DeliveryChannel and the ServiceMixClient Interface. So my question is do I
have to close them? Or Maybe is it better to create instances for my bean
class for each exchange (I think my solution is ok, because its easier to
handle multible calls).
Regards
/Steffen
-----
Brockhaus GmbH
COMPETITIVE THROUGH KNOWLEDGE
Web: http://www.brockhaus-gruppe.de www.brockhaus-gruppe.de /
http://www.brockhaus-group.com www.brockhaus-group.com