out of memory in home.php

Known bugs reported by PacsOne users
Post Reply
tburba
Posts:50
Joined:Fri Apr 23, 2010 5:02 pm
Contact:
out of memory in home.php

Post by tburba » Wed Nov 13, 2013 12:58 pm

A particular server underwent some maintenance and PacsOne (6.3.8) didn't receive images for more than one day. When it was started again, after the login the web interface loads very slowly and finally fails to open:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 47 bytes) in F:\PACS\PacsOne\php\database.php on line 196
The logic in home.php dictates to list all studies if there are no studies for today. But, our server holds more than 0.5M of studies. Increasing PHP's memory_limit might help for a while, at a cost of very slow web interface.

home.php contains a comment about only 10 entries, and a corresponding limit clause for Oracle -- but none for PacsOne. This helped for me:

Code: Select all

--- home.php.131112	2013-09-19 10:25:22.000000000 +0300
+++ home.php	2013-11-12 11:46:39.616672200 +0200
@@ -72,6 +72,8 @@
         $key .= " ROWNUM <= 10";
         $order = "order by study.received desc";
     }
+    else
+        $order .= " LIMIT 10";
     $query .= $key . " " . $order;
     $result = $dbcon->query($query);
     while ($row = $dbcon->fetch_array($result, "ASSOC")) {

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Wed Nov 13, 2013 6:10 pm

Thanks for the great catch, and we'll fix this bug in the next release of PacsOne Server.

Post Reply