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

Morales Pinzon, Alfredo AMORALESPINZON at BWH.HARVARD.EDU
Mon Jun 6 13:33:10 EDT 2022


Hi Xavier,

Thank you, now it’s working. I’m running LORIS 23.0.2.

I struggled a little cause I didn’t know if the line “print $response->getBody();”  was supposed to be replaced or not. After testing I figured out it has to be replaced, otherwise I cannot even get a token.

Best,
Alfredo.

On Jun 1, 2022, at 1:44 PM, Xavier Lecours Boucher, Mr <xavier.lecoursboucher at mcgill.ca<mailto:xavier.lecoursboucher at mcgill.ca>> wrote:

        External Email - Use Caution

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<mailto:loris-dev-bounces at bic.mni.mcgill.ca> <loris-dev-bounces at bic.mni.mcgill.ca<mailto:loris-dev-bounces at bic.mni.mcgill.ca>> on behalf of Morales Pinzon, Alfredo <AMORALESPINZON at BWH.HARVARD.EDU<mailto:AMORALESPINZON at BWH.HARVARD.EDU>>
Sent: May 31, 2022 3:53 PM
To: loris-dev at bic.mni.mcgill.ca<mailto:loris-dev at bic.mni.mcgill.ca> <loris-dev at bic.mni.mcgill.ca<mailto:loris-dev at bic.mni.mcgill.ca>>
Cc: Vladimir S. FONOV <v.s.fonov at ilmarin.info<mailto:v.s.fonov at ilmarin.info>>; Sridar Narayanan, Dr. <sridar.narayanan at mcgill.ca<mailto:sridar.narayanan at mcgill.ca>>; Guttmann, Charles, M.D. <guttmann at bwh.harvard.edu<mailto: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://secure-web.cisco.com/19Xn1xkn4b3-sRGHnfX12KxJD_v-e0qwKTzXYxPYWXqoWcX-GJKFEPdgPQdtrGREi9fmjt0ksBKSqe66_VjQccu0NQPWjBxOqEwj8KFxpvlnHE_4bHa9aPT-GEHg6GwUS3zirAQAW9tUIsObknMn6uE2t28Hzmsxb9s6qvPgZehpoZ3leS8GkaQPNbEErNQcqAOZv0xHywYT9PvJpWm7QyaYJ9guZxDC57fFqsqVXJ1t6aq2s6G88SMuDysPHUT2ClssKO2rfLHm-vJkuQHUI5KcJO8W2vK1vd4zoecHI5D76VeygSHlsPIZdSTd90XWCl_ce_WaY-UaNlP2WnGD6sg/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline><https://www.massgeneralbrigham.org/complianceline<https://secure-web.cisco.com/19Xn1xkn4b3-sRGHnfX12KxJD_v-e0qwKTzXYxPYWXqoWcX-GJKFEPdgPQdtrGREi9fmjt0ksBKSqe66_VjQccu0NQPWjBxOqEwj8KFxpvlnHE_4bHa9aPT-GEHg6GwUS3zirAQAW9tUIsObknMn6uE2t28Hzmsxb9s6qvPgZehpoZ3leS8GkaQPNbEErNQcqAOZv0xHywYT9PvJpWm7QyaYJ9guZxDC57fFqsqVXJ1t6aq2s6G88SMuDysPHUT2ClssKO2rfLHm-vJkuQHUI5KcJO8W2vK1vd4zoecHI5D76VeygSHlsPIZdSTd90XWCl_ce_WaY-UaNlP2WnGD6sg/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline>> .
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<mailto:Loris-dev at bic.mni.mcgill.ca>
https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev<https://secure-web.cisco.com/1SRATtcJN8mR3gVYhf8wjH6_Novm6aJ3dARF2iUwiswpC92wu1AtsyGLwir5GQk5R84IA3r6JavmDpqUzwL_sauPcOoVayH8E5SRGuuz4NJvl71mpJZFn1hYK82mYlScvdBCz-MqqFTGbbEmh1QeIT4Tzxu7HRm9esC-CLf1KYsoZ9MVdX_bcijR8ti0vVk74k6mVIrqRHGvf2hKlENITA1GEj_I_ogovktBMxtRydH3A_RcfBF5H_4tKjF1Kje2S_7-txcQktszdEWcyh0ayVJM93u8NspqcYO8ivgMQXYuaWHyBM0qeEHgweMeCInU9R7DQiRQk5lcdy54rRdviUw/https%3A%2F%2Fmailman.bic.mni.mcgill.ca%2Fmailman%2Flistinfo%2Floris-dev>

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. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20220606/3c3077a9/attachment-0001.html>


More information about the Loris-dev mailing list