MantisBT - ATutor
View Issue Details
0003720ATutorFile Storagepublic2009-03-02 07:022010-09-22 11:50
harris 
harris 
normalminoralways
closedfixed 
 
2.0 
SVN
0003720: File storage exhausted in memory
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8255806 bytes) in include\classes\zipfile.class.php on line 233

Notice allowed size 33554432 > 8255806


Reproduce this problem by:
---------------------------
My php.ini memory_size is at 32M
tried downloading a 15M .zip file ==> Ok
tried downloading a 13M .mp3 file ==> Ok
tried downloading a 13M .txt file ==> Ok
tried downloading a 15M .zip file + a 4kb jpg ==> Error
tried downloading a 13M .mp3 file + a 4kb jpg ==> Error
tried downloading a 13M .txt file + a 4kb jpg ==> Ok

Since mp3 and zip files are already compressed, gzcompress() can't reduce the file anymore. I am not too sure how gzcompress handles the zipping process. It might actually stores the file in memory several times before putting it all together, clogging up the memory.

If you make the memory_size to 4 times the download size, it would work. (It could be that gzcompress() loop through the process 4 times before compressing?)
No tags attached.
related to 0004289closed harris zipfile.class.php revised 
Issue History
2009-03-02 07:02harrisNew Issue
2009-03-02 07:02harrisAffects version => SVN
2010-05-13 07:36harrisRelationship addedrelated to 0004289
2010-05-13 08:13harrisStatusnew => resolved
2010-05-13 08:13harrisResolutionopen => fixed
2010-05-13 08:13harrisAssigned To => harris
2010-05-13 08:13harrisNote Added: 0004283
2010-05-13 08:24harrisStatusresolved => feedback
2010-05-13 08:24harrisResolutionfixed => reopened
2010-05-13 08:24harrisStatusfeedback => resolved
2010-05-13 08:24harrisFixed in Version => 2.0
2010-05-13 08:24harrisResolutionreopened => fixed
2010-09-22 11:50gregStatusresolved => closed

Notes
(0004283)
harris   
2010-05-13 08:13   
svn: 9930