UPD: I’ve found a way to reproduce it. And looks like there’s a bigger problem underneath.
Here’s a screenshot of the memory usage on my machine (max is 24Gb):
imageedit_10_4681932765.gif (24.0 KB)
Here’s piece of code that’s executed in a loop:
MapiMessage message = convert(%input[i]%);
The first line corresponds to the changes in memory, that are marked with green circles.
The second line corresponds to the changes in memory, that are marked with red circles.
(I was using breakpoints, that’s why there are delays between green and red circles)
Each message has an attachment that is ~400Mb.
As you can see,
addMessage() method uses a huge amount of memory comparing to the real size of message. Looks like there’s a lot of memory leaks.
The last long red oval marks the place, where we’re stuck inside
addMessage() method. Garbage collector is trying to free the memory (which causes high CPU usage) for the method to proceed. I think that this method should throw some exception after some time and not just hang till the app dies with OutOfMemory.
What are your thoughts on this issue?