Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: OutOfMemoryException when calling ’Send’. Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
HJB
Newbie
Newbie


Joined: 17 February 2013
Location: Germany
Online Status: Offline
Posts: 4
Posted: 31 October 2014 at 3:01am | IP Logged Quote HJB

Hi,

we use a MailBee.SmtpMail.Smtp object to send emails in a loop to for e.g. 1.000 recipients. If the mail has some bigger attachments (tested with 15-30 MBs) we get an OutOfMemoryException when calling 'Send' after for e.g. 37, 185 or 467 mails (depending on the size of the attachments) were successfuilly sent. We call GC.Collect after each mail sent to clean up memroy and we use Message.Reset and Message.Attachments.Clear to re-initialize before preparing and sending the next mail. Any hints on the reason for this and how to avoid OutOfMemoryException in this szenario? Thanks...

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

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 31 October 2014 at 3:09am | IP Logged Quote Alex

Are you sure you don't have attachments remain in memory somehow? I.e. if you get them into memory with your own code, then add them to MailMessage but they still reside in memory after MailMessage gets cleared as they are independent objects?

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


Joined: 17 February 2013
Location: Germany
Online Status: Offline
Posts: 4
Posted: 31 October 2014 at 11:00pm | IP Logged Quote HJB

Hi Alex,

i only use pathes/filenames to address files on hard disk, the PDFs or other attachments are NOT loaded into memory at any point.

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

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 04 November 2014 at 1:48am | IP Logged Quote Alex

If you're using SubmitToPickupFolder instead of Send, does the problem still occur? You can save to any folder, it's not important that the mails will not actually be sent, it's just for debugging purposes.

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

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