[Loris-dev] PHP Fatal error: Allowed memory size of

Xavier Lecours Boucher, Mr xavier.lecoursboucher at mcgill.ca
Wed Jun 1 13:44:03 EDT 2022


Hi Alfredo,

Are you running LORIS 22?
I am asking because LORIS 23 added the following at the end of index.php:


// Include the body.
$bodystream = $response->getBody();

// First we need to disable any output buffering so that
// it streams to the output instead of into the buffer
// and uses up all the memory for large chunks of data.
for ($i = ob_get_level(); $i != 0; $i = ob_get_level()) {
    ob_end_clean();
}
ob_implicit_flush();

while ($bodystream->eof() == false) {
    // 64k oughta be enough for anybody.
    print $bodystream->read(1024*64);
}

Try adding those lines if they are not there. Let us know if the issue persists.

-  Xavier Lecours


________________________________
From: loris-dev-bounces at bic.mni.mcgill.ca <loris-dev-bounces at bic.mni.mcgill.ca> on behalf of Morales Pinzon, Alfredo <AMORALESPINZON at BWH.HARVARD.EDU>
Sent: May 31, 2022 3:53 PM
To: loris-dev at bic.mni.mcgill.ca <loris-dev at bic.mni.mcgill.ca>
Cc: Vladimir S. FONOV <v.s.fonov at ilmarin.info>; Sridar Narayanan, Dr. <sridar.narayanan at mcgill.ca>; Guttmann, Charles, M.D. <guttmann at bwh.harvard.edu>
Subject: [Loris-dev] PHP Fatal error: Allowed memory size of

Dear LorisDev team,

I’m facing the following error when downloading a large minc image (~70MB) using the API “GET /candidates/$CandID/$VisitLabel/images/$Filename”. I can download the file from the web interface with no issues.

===
[Tue May 31 15:25:10.697608 2022] [php7:error] [pid 20168] [client 73.219.242.88:64779] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 70594560 bytes) in /var/www/loris/htdocs/index.php on line 63
===

I googled the error but couldn’t find a solution, do you know how fix this?

Best regards,
Alfredo.
The information in this e-mail is intended only for the person to whom it is addressed.  If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline <https://www.massgeneralbrigham.org/complianceline> .
Please note that this e-mail is not secure (encrypted).  If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately.  Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.

_______________________________________________
Loris-dev mailing list
Loris-dev at bic.mni.mcgill.ca
https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20220601/e7484e52/attachment.html>


More information about the Loris-dev mailing list