On May 28, 2010, at 10:22 AM, Davide Cittaro wrote:
Hi all, I've noticed that when I try to visualize a BAM file on UCSC (with display_application) the galaxy web process drains RAM and never releases it... I easly go in OutOfMemory error. Is it trying to load BAM (or any other custom file defined to be visualized in the same way) in RAM? Can anybody explain how display_application works and how to debug it?
Mmm... apparently the Paste egg loads the file to be shown to UCSC in memory (and there's no close()). I see this egg is not developed by GalaxyTeam, so I don't know if this should be issued as a galaxy bug. BTW, I've tried this
$ diff -u Paste-1.6-py2.6.egg/paste/wsgilib.py.tmp Paste-1.6-py2.6.egg/paste/wsgilib.py --- Paste-1.6-py2.6.egg/paste/wsgilib.py.tmp 2010-05-28 11:06:00.174278394 +0200 +++ Paste-1.6-py2.6.egg/paste/wsgilib.py 2010-05-20 10:44:49.354765626 +0200 @@ -15,7 +15,6 @@ from traceback import print_exception import urllib from cStringIO import StringIO -import tempfile import sys from urlparse import urlsplit import warnings @@ -527,8 +526,7 @@ "If you provide conditional you must also provide " "start_response") data = [] - #output = StringIO() - output = tempfile.NamedTemporaryFile(dir='/data/galaxy_dist/database/tmp') + output = StringIO() def replacement_start_response(status, headers, exc_info=None): if conditional is not None and not conditional(status, headers): data.append(None) @@ -551,9 +549,7 @@ data.append(None) if len(data) < 2: data.append(None) - #data.append(output.getvalue()) - output.seek(0) - data.append(output.read()) + data.append(output.getvalue()) return data
## Deprecation warning wrapper:
Essentially substituting the cStringIO handler with a temporary file. A temporary file for each galaxy history item I would like to see on UCSC is created, in multiple copies... Still the output is read and never released so memory easily drains...
d
d /* Davide Cittaro
Cogentech - Consortium for Genomic Technologies via adamello, 16 20139 Milano Italy
tel.: +39(02)574303007 e-mail: davide.cittaro@ifom-ieo-campus.it */
galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
/* Davide Cittaro
Cogentech - Consortium for Genomic Technologies via adamello, 16 20139 Milano Italy
tel.: +39(02)574303007 e-mail: davide.cittaro@ifom-ieo-campus.it */