MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0006443 | VTK | (No Category) | public | 2008-02-26 04:25 | 2013-04-05 19:57 |
Reporter | Levap | ||||
Assigned To | David Partyka | ||||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Project | |||||
Type | |||||
Summary | 0006443: vtkFixedPointVolumeRayCastMapper throw std::bad_alloc | ||||
Description | I’m using vtkFixedPointVolumeRayCastMapper for volume rendering and in some cases my application crashes or freezes. The behavior was verified on two machines: Windows XP 32bit SP2 with 1 GB RAM and Windows 64bit XP SP1 with 4 GB RAM. Compiler: Visual Studio 2008 Prof. The volume I used was (512x512x512x4) = 512 MB big. After a little debug orgy I found out that the problem lies within the memory allocation during in the function ComputeGradients(). Below are the lines from code (line 3061): this->ContiguousGradientNormal = new unsigned short [numSlices * sliceSize]; this->ContiguousGradientMagnitude = new unsigned char [numSlices * sliceSize]; During the shading computation the algorithm tries to allocate additional contiguous memory: (512x512x512x2) = 256 MB and (512x512x512x1) = 128 MB. In same cases the operational system fails to provide so much free contiguous memory, so the “new” operator fails and throw an exception (std::bad_alloc). The function and the gradient computation will be aborted -> memory leaks and inconsistency in program flow arises. | ||||
Steps To Reproduce | |||||
Additional Information | My temporal solution was to change the two line of code like following: this->ContiguousGradientNormal = new(std::nothrow) unsigned short [numSlices * sliceSize]; this->ContiguousGradientMagnitude = new(std::nothrow) unsigned char [numSlices * sliceSize]; It is also possible to use try/catch! My question is: what is the right strategy in this case? | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2008-02-26 04:25 | Levap | New Issue | |||
2009-02-13 06:11 | Ivan Macia | Note Added: 0014922 | |||
2010-04-12 09:43 | David Partyka | Status | backlog => tabled | ||
2010-04-12 09:43 | David Partyka | Assigned To | => David Partyka | ||
2010-04-12 10:10 | David Partyka | Note Added: 0020135 | |||
2010-04-12 10:10 | David Partyka | Status | tabled => @80@ | ||
2010-04-12 10:10 | David Partyka | Resolution | open => fixed | ||
2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
2013-04-05 19:57 | Berk Geveci | Status | customer review => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|