[Insight-users] Resampling 64-bit crash

Yao, Weiguang wyao at hrsrh.on.ca
Wed Feb 14 10:52:39 EST 2007


Hi, Florian:

Agree. Hope some people fix this since image processing is going to need
more and more memory.

Weiguang

-----Original Message-----
From: Florian Pierron [mailto:F.Pierron at exeter.ac.uk]
Sent: Wednesday, February 14, 2007 10:48 AM
To: Yao, Weiguang; Thomas Lambertz; insight-users at itk.org;
r.atwood at imperial.ac.uk
Subject: Re: [Insight-users] Resampling 64-bit crash


Hi Weiguang,

Thank you for your test. I thought ITK support 64-bit addressing and 
this was just a bug but maybe I'm wrong, maybe I was too optimistic... 
But sooner or later, I'm sure it will :-) if it doesn't already support 
it ;-)

Thanks,
Florian

On 14/02/2007 15:41, Yao, Weiguang wrote:
>
> Hi Florian:
>
> I tried to use 8GB with 64-bit but didn't succeed. Now I move the part 
> of program requiring
> more than 4GB memory out of the ITK, and it works.
>
> Weiguang
>
> -----Original Message-----
> From: insight-users-bounces+wyao=hrsrh.on.ca at itk.org
> [mailto:insight-users-bounces+wyao=hrsrh.on.ca at itk.org]On Behalf Of
> Florian Pierron
> Sent: Wednesday, February 14, 2007 10:21 AM
> To: Thomas Lambertz; insight-users at itk.org
> Subject: Re: [Insight-users] Resampling 64-bit crash
>
>
> Hi Thomas,
>
> Thank you for your answer! Yes, I agree with you the allocated memory
> seems to be modulo 4GB as you said and that's why I was wondering if
> there's a problem in ITK to go over this 4GB limit of 32-bit
> applications. Thank you for your input, maybe my question should be
> reformulated to: "Does anyone know if ITK support 64-bit addressing?"
>
> Thanks again,
> Florian
>
> On 14/02/2007 15:02, Thomas Lambertz wrote:
> > Hi Florian,
> >
> > i doubt ITK supports 64bit addressing even when compiled for the 64bit
> > plattform.
> >
> > About 3)
> > The allocated memory seemes to be modulo 4GB - (4GB = 4294967296 =
> > approximatly 4.3 billion bytes)
> > 5 - 4.3 = 0.7
> > 7 - 4.3 = 2.7 (2.65)
> > 10 - 2 * 4.3 = 1.4
> > (looks you set 5 * 1,000 * 1,000 * 1,000Byte = 5GB)
> >
> > But i havent exceeded 4GB by myself - so more advanced users surely
> > can tell you more about this.
> >
> > Regards,
> > Tom
> >
> >
> >
> >
> >
> >
> >
> > Florian Pierron schrieb:
> >> Dear ITK users and developers,
> >>
> >> We need to resample big data and we decided to port our application
> >> in 64-bit version. We're currently working on Windows Server 2003,
> >> Enterprise x64 Edition, Dual Core AMD Opteron and using ITK-3-0
> >> branch with VC2005. Unfortunately our application crashes when trying
> >> to resample big data.
> >>
> >> We reproduced the crash with the ResampleImageFilter example
> >> (D:\InsightToolkit-3.0.0\Examples\Filtering\ResampleImageFilter.cxx)
> >> by changing the size of the output image to be more than 3-4 GB:
> >> Line 279:    size[0] = 5 * 1000 * 1000;  // number of pixels along X
> >> Line 280:    size[1] = 1 * 1000;  // number of pixels along Y
> >>
> >> We run this example by setting the working directory to
> >> "D:\InsightToolkit-3.0.0\Testing\Data\Input" and the command line
> >> arguments to
> >> "BrainSliceBinary.png BrainSliceBinaryOutput.png 0" (a random image I
> >> found in the ITK folder).
> >>
> >> 1) If I run this example with the modified size above (5 GB), it
> >> crashes immediately in:
> >>
> >>  /** Set the pixel. */
> >>  inline void Set(TType & output, const TType & input) const
> >>    {output = input;}
> >>
> >> with this call stack:
> >>
> >>     ResampleImageFilter.exe!itk::DefaultPixelAccessor<unsigned
> >> char>::Set(unsigned char & output=, const unsigned char & input=0) 
> >> Line 67 + 0x1d bytes
> >>    
> >> 
>
ResampleImageFilter.exe!itk::DefaultPixelAccessorFunctor<itk::Image<unsigned

>
> >> char,2> >::Set(unsigned char & output=, const unsigned char &
> >> input=0)  Line 77
> >>    
> >> 
>
ResampleImageFilter.exe!itk::ImageLinearIteratorWithIndex<itk::Image<unsigne
d 
>
> >> char,2> >::Set(const unsigned char & value=0)  Line 106 + 0x47 bytes
> >>    
> >> ResampleImageFilter.exe!itk::ResampleImageFilter<itk::Image<unsigned
> >> char,2>,itk::Image<unsigned
> >> char,2>,double>::LinearThreadedGenerateData(const itk::ImageRegion<2>
> >> & outputRegionForThread={...}, int threadId=2)  Line 481
> >>    
> >> ResampleImageFilter.exe!itk::ResampleImageFilter<itk::Image<unsigned
> >> char,2>,itk::Image<unsigned
> >> char,2>,double>::ThreadedGenerateData(const itk::ImageRegion<2> &
> >> outputRegionForThread={...}, int threadId=2)  Line 192
> >>     ResampleImageFilter.exe!itk::ImageSource<itk::Image<unsigned
> >> char,2> >::ThreaderCallback(void * arg=0x0000000002c2f4f8)  Line 282
> >>    
> >> ResampleImageFilter.exe!itk::MultiThreader::SingleMethodProxy(void *
> >> arg=0x0000000002c2f4f8)  Line 748
> >>     msvcr80d.dll!_callthreadstartex()  Line 348 + 0x17 bytes
> >>     msvcr80d.dll!_threadstartex(void * ptd=0x0000000002c3c8f0)  
> Line 331
> >>
> >>
> >> 2) If I change the size to be 2GB, it's running fine. The limit
> >> between crashing and not crashing seems to be between 2 and 3 GB
> >> (with 8 threads).
> >>
> >> 3) If I force the SetNumberOfTheads to 1, it doesn't crash
> >> immediately (I think it crashes later, but it's quite slow so most of
> >> the time I killed it before). The funny thing is that when the number
> >> of threads is equal to 1:
> >> - if the size is 4 GB, then 4 GB of memory is allocated immediately
> >> - but if the size is 5 GB, only 700 MB is allocated
> >> - for 7 GB, 2.65 GB is allocated
> >> - for 10 GB, 1.4 GB is allocated (which is weirdly twice the 5GB)
> >> I have no idea if this is meaningful at all, I was just wondering if
> >> there's a problem during memory allocation when the 4GB limit is
> >> reached...
> >>
> >>
> >> Any ideas?
> >>
> >> Cheers,
> >> Florian
> >>
> >> _______________________________________________
> >> Insight-users mailing list
> >> Insight-users at itk.org
> >> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >
> >
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> **********************************************************************
> The information contained in this email and document(s)attached are 
> for the exclusive use of the addressee and may contain confidential, 
> privileged and non-disclosable information. If the recipient of this 
> e-mail is not the addressee, such recipient is strictly prohibited 
> from reading, photocopying, distributing or otherwise using this 
> e-mail or its content in any way.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>   
**********************************************************************
The information contained in this email and document(s)attached are for the
exclusive use of the addressee and may contain confidential, privileged and
non-disclosable information. If the recipient of this e-mail is not the
addressee, such recipient is strictly prohibited from reading, photocopying,
distributing or otherwise using this e-mail or its content in any way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070214/04e295ca/attachment-0001.htm


More information about the Insight-users mailing list