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

Bug: DownloadResponse Fails with Large Files #5620

Closed
MGatner opened this issue Jan 26, 2022 · 1 comment · Fixed by #5623
Closed

Bug: DownloadResponse Fails with Large Files #5620

MGatner opened this issue Jan 26, 2022 · 1 comment · Fixed by #5623
Assignees
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@MGatner
Copy link
Member

MGatner commented Jan 26, 2022

PHP Version

7.4, 8.0

CodeIgniter4 Version

4.1.8

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

macOS, Linux

Which server did you use?

apache

Database

MySQL

What happened?

DownloadResponse is set up to stream file data in chunks to circumvent memory issues, but something is still causing memory overflows:

CRITICAL - 2022-01-25 16:53:30 --> Allowed memory size of 134217728 bytes exhausted (tried to allocate 67112960 bytes)
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}

Steps to Reproduce

I have created a repo to demonstrate the error: https://github.com/MGatner/codeigniter-error

Expected Output

We need to be able to support large file downloads.

Anything else?

Ivan proposed it "may be due to output buffering maybe enabling ob_implicit_flush on downloads" in this Slack conversation, a good place to start.

@MGatner MGatner added the bug Verified issues on the current code behavior or pull requests that will fix them label Jan 26, 2022
@kenjis kenjis self-assigned this Jan 27, 2022
@kenjis
Copy link
Member

kenjis commented Jan 27, 2022

@MGatner Try #5623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants