Closed michaeleekk closed 2 years ago
if you use "Welch's t-test (cellxgene)", will this memory issue happens?
@z5ouyang I forgot to mention which one I used. I used "Welch's t-test (diffxpy)" when I created this issue. The memory usage is like this,
I just tried with "Welch's t-test (cellxgene)", the memory usage is like this,
So "Welch's t-test (cellxgene)" didn't have the issue but only "Welch's t-test (diffxpy)".
@michaeleekk sorry for the delay, many projects. Do you mind to set up a pull request? thanks!
@z5ouyang I created #72 for this issue. Hope it helps !
Issue
It might not be exactly be the memory leak but I thought this would be easiest to be understood. The issue is that when I ran DEG a few times against a dataset with a significant size, around 3GB to 8GB, it will consume a lot of memory and the program crashed because of out of memory issue. At the
createData()
andDEG()
, it consumed memory significantly, which should be obvious to the writer I believe, when I profiled with memory-profiler.I wonder if this issue would be fixed or not ?
The workaround I did right now is to modify the
route()
to fork a sub process to run theDEG()
function and return only the result CSV back to the parent process. This way, the memory usage will be constant on the parent process when I tested with the following test case.The test case's code
I uploaded the modified
VIPInterface.py
to pastebin, https://pastebin.pl/view/941d8988. The main changes are adding@profile
oncreateData()
andDEG()
and to remove the dependency on the Flask app so it could be a self-contained testable code.The test case body is as followed,
The
data.json
is dataset dependent so I didn't include it in this issue, but it should be able to be captured from the browser.Workaround code
This is the workaround that I did on
route()
,