Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file: large file downloads choke due to memory issues (Trac #1932) #1932

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 17 comments
Closed

file: large file downloads choke due to memory issues (Trac #1932) #1932

elgg-gitbot opened this issue Feb 16, 2013 · 17 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/1932 on 40172233-12-10 by cash, assigned to trac user mcloughlin3.

Elgg version: 1.7

You should be able to download a file that you uploaded. This doesn't work for large files because of the chunking scheme. The code basically loads the file into memory twice which causes crashes on large files.

@elgg-gitbot
Copy link
Author

brettp wrote on 40768944-09-15

Related to #1536.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8.1 by ewinslow on 40895152-01-30

@elgg-gitbot
Copy link
Author

trac user roho wrote on 41083568-12-11

I have the same issue with file uploads. I'm using the 1.7.6 version and i tried to upload a file that isn't even that big. i tried to upload a photo that is only 104 kb and 769x1024 and got the error below

Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 3072 bytes) in /htdocs/elgg/engine/lib/filestore.php on line 827

@elgg-gitbot
Copy link
Author

cash wrote on 41084063-07-17

Replying to roho:

Your issue is that PHP only has 10 MB allocated to it. You'll have a tough time running Elgg without a configuration change.

@elgg-gitbot
Copy link
Author

trac user roho wrote on 41086232-09-25

Replying to cash:

Replying to roho:

Your issue is that PHP only has 10 MB allocated to it. You'll have a tough time running Elgg without a configuration change.

i changed the upload to 64 mb and i'm able to upload the photos now. however, i tried uploading pdf files, one was 300 kb, and the other was 1.6 mb, and neither of them uploaded. i didn't get that error, but the file just showed up with the adobe acrobat icon and it was o kb. so it was not uploaded. the pdf files that i attempted to upload were created from adobe acrobat

@elgg-gitbot
Copy link
Author

ewinslow wrote on 41086352-01-27

Replying to roho:

i changed the upload to 64 mb and i'm able to upload the photos now. however, i tried uploading pdf files, one was 300 kb, and the other was 1.6 mb, and neither of them uploaded. i didn't get that error, but the file just showed up with the adobe acrobat icon and it was o kb. so it was not uploaded. the pdf files that i attempted to upload were created from adobe acrobat

Check post_max_size and upload_max_filesize. Also, this is not a support forum, so you should use the community site for any further inquiries and report a bug only once you've confirmed that it is indeed a problem with Elgg.

@elgg-gitbot
Copy link
Author

trac user roho wrote on 41087604-02-16

ok, i'm sorry. i appreciate your help. I'm new to the Elgg community, so I didn't know. my apologies

@elgg-gitbot
Copy link
Author

ewinslow wrote on 41087735-10-29

No worries, thanks for your understanding! I hope I didn't come across too terse, there. Welcome to Elgg!

@elgg-gitbot
Copy link
Author

trac user mcloughlin3 wrote on 41420917-01-07

The problem seems to be that Elgg loads the entire file into memory in the process of downloading/uploading it.

@elgg-gitbot
Copy link
Author

cash wrote on 41420968-02-07

As far as I know, PHP requires the entire file in memory for upload. It does not for download - that is just bad coding in Elgg.

@elgg-gitbot
Copy link
Author

trac user mcloughlin3 wrote on 41420981-07-15

I recall reading that in the PHP docs as well, however now I'm not so sure. I was able to uploaded 500+ MB files using the patch I have in the pull queue with PHP memory limit set to 128M.

@elgg-gitbot
Copy link
Author

cash wrote on 41420994-06-08

Huh, very cool. I think it is worth pulling this in on 1.7.10 and 1.8.0.

@elgg-gitbot
Copy link
Author

cash wrote on 41421071-12-24

#33

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.7.10 by cash on 41421071-12-24

@elgg-gitbot
Copy link
Author

brettp wrote on 41453615-10-22

(In [svn:9205]) Refs #1932. Pulled in Russell's patches for 1.7. Still need to merge on GH for 1.8.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8 Beta 2 by brettp on 41453616-11-30

@elgg-gitbot
Copy link
Author

cash wrote on 41479787-01-10

Pulled in the changes into the master branch: [344e478]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant