View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003283 | Slicer4 | Module Editor | public | 2013-08-09 13:12 | 2014-03-06 06:15 |
Reporter | lassoan | Assigned To | pieper | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.4.0 | Fixed in Version | Slicer 4.4.0 | ||
Summary | 0003283: Crash in editor due to out of memory | ||||
Description | There is a huge memory leak in the Editor module that causes crash in a few clicks (depending on the volume size and available memory), using any editor effect. How to reproduce:
On my computer with the CTChest sample you have to click 57 times (which is a quite low number when a full volume is segmented manually), with the CTACardio the crash occurs after 25 clicks, and on a high-resolution CT it happens after 12 clicks. Slicer 4.2.0-2013-08-07 (Win64), on Win7, 8GB RAM | ||||
Tags | No tags attached. | ||||
From: Steve Pieper [mailto:pieper@ibility.net] Yes, it must be something like that. If we rule out the editor's undo buffer we can look at other things. The easiest thing is probably to override the Register and UnRegister virtual methods in vtkImageData and set breakpoints to see where the reference count is being incremented but not decremented. -Steve On Fri, Aug 9, 2013 at 6:52 PM, Andras Lasso <lasso@cs.queensu.ca> wrote: Maybe the input volume is saved in the undo buffer as well (because something marks it as modified)? Andras From: Steve Pieper [mailto:pieper@ibility.net] To: Andras Lasso No, the undo data is compressed. But there might be something else going on which is why I suggested you test it. -Steve On Fri, Aug 9, 2013 at 6:37 PM, Andras Lasso <lasso@cs.queensu.ca> wrote: thanks From: Steve Pieper [mailto:pieper@ibility.net] Hi Andras - No problem - will look into it. It's probably the undoSize option [1]. It used to be 10 but then I upped it to 100 at the request of some users. You might try changing it if you have a chance. If that turns out to be the issue we should make it configurable. [1] https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/EditorLib/EditUtil.py#L231 Best, |
|
undoSize set to 5 => the problem is resolved, total amount of leaks is limited self.undoRedo.saveState() is commented out => the problem is resolved, no leaks at all So, the problem seems to be in the undo/redo buffer. |
|
Root cause of the problem found: the image stash compresses the buffer but then the buffer is not squeezed (it left at the default size, which is about the same size as the input uncompressed buffer). Solution: Replace these lines in vtkImageStash::Stash() this->SetStashedScalars(this->GetCompressor()->Compress(p, scalarSize)); by these: vtkUnsignedCharArray* compressedBuffer=this->GetCompressor()->Compress(p, scalarSize); // returns a new buffer that has to be deleted Steve, please review and if you agree then commit. |
|
There is one remaining issue: if the user clicks too quickly then Slicer may run out of memory due to the many stashing going on in processing threads. I've added a new bug report for this issue: http://www.na-mic.org/Bug/view.php?id=3286 |
|
Fix committed in rev 22284 (http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22284). |
|
Closing resolved issues that have not been updated in more than 3 months |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2013-08-09 13:12 | lassoan | New Issue | |
2013-08-09 13:12 | lassoan | Status | new => assigned |
2013-08-09 13:12 | lassoan | Assigned To | => pieper |
2013-08-09 13:26 | lassoan | Description Updated | |
2013-08-09 21:42 | lassoan | Note Added: 0009454 | |
2013-08-09 21:43 | lassoan | Note Added: 0009455 | |
2013-08-09 22:08 | lassoan | Note Added: 0009456 | |
2013-08-09 22:08 | lassoan | Note Added: 0009457 | |
2013-08-13 08:09 | lassoan | Note Added: 0009467 | |
2013-08-13 08:09 | lassoan | Status | assigned => resolved |
2013-08-13 08:09 | lassoan | Resolution | open => fixed |
2014-03-06 05:21 | jcfr | Note Added: 0011164 | |
2014-03-06 05:23 | jcfr | Status | resolved => closed |
2014-03-06 05:54 | jcfr | Fixed in Version | => Slicer 4.4.0 |
2014-03-06 06:15 | jcfr | Target Version | => Slicer 4.4.0 |
2014-04-01 03:40 | pieper | Relationship added | has duplicate 0003619 |