Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Memory Leak Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
aol000xw
Newbie
Newbie


Joined: 13 June 2007
Online Status: Offline
Posts: 3
Posted: 30 August 2007 at 12:02pm | IP Logged Quote aol000xw

Hello

I got a mail, with some PDF attach on it. (24 for a total of 25Mb)

with some code like...

Dim msg As New MailBee.Mime.MailMessage
msg.LoadMessage(Profile.tmpFile)
lbl.Text = msg.Subject

After the LoadMessage, memory usage raises 25Mb, that's ok. As son as I read de subject or To or whatever property (I undertand that reading any of the properties triggers the parsing) the memory usage of my application raises 192Mb and doesn't come back.

So where did those 192Mb Go?

Back to Top View aol000xw's Profile Search for other posts by aol000xw
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 30 August 2007 at 12:08pm | IP Logged Quote Alex

That's not a leak. When you call LoadMessage, the component simply loads the MIME source of the message into memory. When any property which needs the message be parsed is accessed, MailBee checks if the message has already been parsed or not. If not, the message gets parsed and all the properties and collections get filled (the raw MIME source still remains). When you access any property next time, no parsing will be made since the message has already been made.

If you need to get the message back, set msg to null after you got all the data you need. If you do not need to access the body and attachments and just need to examine the headers of the message, you can set 'msg.Parser.ParseHeaderOnly = true;' prior to the moment when the message gets parsed.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 30 August 2007 at 12:16pm | IP Logged Quote Alex

You can also try to update to the latest version of MailBee.NET.dll to see if memory usage decreases with the newer version. The newer version is at least significantly faster in parsing.

You can get it from http://www.afterlogic.com/updates/mailbee_net3.zip

Please let us know the outcome. Thank you.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
aol000xw
Newbie
Newbie


Joined: 13 June 2007
Online Status: Offline
Posts: 3
Posted: 30 August 2007 at 12:37pm | IP Logged Quote aol000xw

Hello I just dowloaded today versión 3.0.0.58. And I always get the same result, but I only noticed it with the single mail I described in my first post.

I'll try to explain it a bit better

Guess I got a memory usage of X
Then I do

Dim msg As New MailBee.Mime.MailMessage

Memory remains de same


msg.LoadMessage(Profile.tmpFile)

Memory usage = X + 25Mb
Perfect as the mail weigths 25Mb

lbl.Text = msg.Subject

Doom over you. Memory Usage = X + 25Mb + 192Mb

And won't go back, no matter if I try to dispose or set to nothing the msg. I understand 192Mb got used while the msg was parsed on and somehow aren't coming back.





lbl.Text = msg.Subject
Back to Top View aol000xw's Profile Search for other posts by aol000xw
 
aol000xw
Newbie
Newbie


Joined: 13 June 2007
Online Status: Offline
Posts: 3
Posted: 30 August 2007 at 12:43pm | IP Logged Quote aol000xw

Tomorrow when I am back to the office I can try to mail you or something the MSG that I described before. But I am not sure if I can mail 25Mb attachments, just tell me how can I submit the msg so you can try it?
Back to Top View aol000xw's Profile Search for other posts by aol000xw
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 31 August 2007 at 1:27am | IP Logged Quote Andrew

We've emailed you the instructions.


Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide