Login   Register  
PHP Classes

Memory effect of using SaveBody

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      MIME E-mail message parser  >  All threads  >  Memory effect of using SaveBody  >  (Un) Subscribe thread alerts  
Subject:Memory effect of using SaveBody
Summary:Easts up memory?
Author:Pontus Lundin
Date:2013-01-13 06:45:53
Update:2013-01-13 09:11:26

  1. Memory effect of using SaveBody   Reply  
Picture of Pontus Lundin
Pontus Lundin
2013-01-13 06:45:53

When using SaveBody It seems that every file is cached, running free-m before and after emailing a image attachment on 1.5MB chanaged it like the table below:

When i in the application click on the images (saved on disk) it gets loaded instanstly in the browser. Is there any php trick to prevent cache files like this? Assume there are some concurrent emails coming it, it will soon eat up all memory

free -m
total used free shared buffers cached
Mem: 3833 2815 1017 0 195 2227
-/+ buffers/cache: 392 3441
Swap: 1023 0 1023

free -m
total used free shared buffers cached
Mem: 3833 2821 1011 0 195 2228
-/+ buffers/cache: 396 3436
Swap: 1023 0 1023

  2. Re: Memory effect of using SaveBody   Reply  
Picture of Manuel Lemos
Manuel Lemos
2013-01-13 09:11:26 - In reply to message 1 from Pontus Lundin
I would need to see your script to understand what you are doing.

If you are saving message image parts to files and point the pages to show the images using the directory where the files were saved, PHP is not used serve the images, so PHP does not control how images may be cached by the browser.

You would need to change the image URLs to some script that serves the images indirectly. You have more caching control and you do not risk yourself to security exploits caused by forged images crafted to abuse your application.