473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Mail reader. Where to store message bodies at runtime

I'm writing an internal mail system module for an application.
The mails are stored on a sql database that may be on a LAN or WAN.
The gui has similar functionality to most email systems where you'd click on
a message header and the message body appears in a read only text box.
To reduce network traffic I plan to download the message body from the
database when a user clicks on the message header and cache it locally until
the form is closed.
Is this the best way to do this? If so, should messages be cached to
temporary files or held in memory or is there a better method?

thank you
Feb 16 '07 #1
1 1314
I personally would save the downloaded files to a temporary folder. You could
hold them in memory but that could cause your app to suck up ram. I would
save them with something like the message id as the name, or make a
Dictionary for the message identifier / path combinations.

The problem I see (although others may see it differently) is that holding
them all in memory will potentially take up a bit of ram if they look through
a lot. This will lead to garbage collections and these strings will be
promoted, potentially to gen 2 which means even when you close your form, you
probably wont garbage collect them for a while and wont get the memory back.
I think streaming the file into a text control which is dumped when the
message is not longer being viewed will keep the strings shortlived so they
will be less likely to get promoted.

HTH

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Claire" wrote:
I'm writing an internal mail system module for an application.
The mails are stored on a sql database that may be on a LAN or WAN.
The gui has similar functionality to most email systems where you'd click on
a message header and the message body appears in a read only text box.
To reduce network traffic I plan to download the message body from the
database when a user clicks on the message header and cache it locally until
the form is closed.
Is this the best way to do this? If so, should messages be cached to
temporary files or held in memory or is there a better method?

thank you
Feb 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marian Heddesheimer | last post by:
Hi folks, I received a complaint from a user that my form mailer sends empty mail bodies. I have tested it and found that my mailer seems fine. But the user still gets empty mail bodies from the...
3
by: Remon Huijts | last post by:
Hi, When I use php mail() in a script on my localhost to send an HTML message to an e-mailaccount on my online host, all is fine. When I use php mail() in a script on my online host to send an...
3
by: tdeclercq | last post by:
HI, I want to be sure that users receive and can read my mails. How can I send mail in HTML AND text Format in one send ? thx
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
8
by: marcmc | last post by:
Trying to send an eMail frommy vb.net App. Is there anybody out there that has successfully done this? I am having major problems and need a step by step guide into the world of system.web and...
1
by: Simon | last post by:
Dear reader, How to print an e-mail address if the address is stored in a datatype Hyperlink field. If I use the Hyperlink field in a report than by print the field shows more as only the...
1
by: Roberto Rocco | last post by:
Hello, I'm using VS 2005 and I need to send a mail body which contains german umlauts (ä,ö,ü). When I receive the mail in Outlook 2003 (english operating system) I always get a '|' or other...
4
by: Sonnich Jensen | last post by:
Hi all! I use the following for sending mail from ASP, but there is a problem - it goes to a intranet thing (eRoom) which does not read it, while Outlook etc does not have any problems. eRoom...
4
by: jodleren | last post by:
Hi fellow I read about this here, and I need a simple form to post and mail a simple table (formatting) in HTML. My message is somthing like: <html><body><table.... I have a header as this. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.