I think there is another problem with your code and it just fails in that place - you are probably overwriting memory somewhere. By having a vector<vector<vector<double> > > > and then just allocating the first to size of x*y, you will result in a vector or length x*y each containing empty vector<vector<double> >'s. Are you sure this is what you want? (if that makes sense)<div>
<br></div><div>If you post the code I will look.</div><div><br></div><div>Regards,</div><div>Paul</div><div><br><div class="gmail_quote">2009/9/17 Fred Fred <span dir="ltr"><<a href="mailto:stan1313@hotmail.fr">stan1313@hotmail.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Yes this is exactly the line of code that fails, I put printf();getchar(); items before and after (sorry I do not use a debugger).<br>Ok I may send the code but I doubt it could help because, this line is clear and I checked the argument (=100), so what?<br>
<br><hr>Date: Thu, 17 Sep 2009 16:34:29 +0100<div class="im"><br>Subject: Re: [Paraview] PV and the STL: memory allocation issue<br></div>From: <a href="mailto:paul.m.edwards@gmail.com" target="_blank">paul.m.edwards@gmail.com</a><br>
To: <a href="mailto:stan1313@hotmail.fr" target="_blank">stan1313@hotmail.fr</a><br>CC: <a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>; <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><div>
<div></div><div class="h5"><br><br>Are you running this through a debugger? And, is that the line that it is failing on? Finally, can you post the PV code that is failing?<br><br>Regards,<br>Paul<br><br><br><div>2009/9/17 Fred Fred <span dir="ltr"><<a href="mailto:stan1313@hotmail.fr" target="_blank">stan1313@hotmail.fr</a>></span><br>
<blockquote style="padding-left:1ex">
<div>
Hmmm, doubtful since in my test this->grid_xsize == this->grid_ysize == 10 !!<br><br>> Date: Thu, 17 Sep 2009 08:11:43 -0400<br>> Subject: Re: [Paraview] PV and the STL: memory allocation issue<br>> From: <a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a><br>
> To: <a href="mailto:stan1313@hotmail.fr" target="_blank">stan1313@hotmail.fr</a><br>> CC: <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><div><div></div><div><br>> <br>
> In all likelihood, the allocation is failing because the process is<br>> unable to allocate the memory you ask it to. I am not surprised that<br>> this happens in ParaView not in VTK because ParaView tends to<br>
> allocate a fair number of small objects probably segmenting the memory<br>> somewhat. Did you try a 64 bit ParaView?<br>> <br>> On Wed, Sep 16, 2009 at 11:16 AM, Fred Fred <<a href="mailto:stan1313@hotmail.fr" target="_blank">stan1313@hotmail.fr</a>> wrote:<br>
> > I use the STL through vtkstd:<br>> ><br>> > vtkstd::vector<vtkstd::vector<vtkstd::vector<double> > > grid;<br>> > [...]<br>> > this->grid.clear();<br>> > this->grid = vtkstd::vector<vtkstd::vector<vtkstd::vector<double> ><br>
> >>(this->grid_xsize*this->grid_ysize);<br>> ><br>> > It works well on VTK but on PV I can this error at run time:<br>> ><br>> > terminate called after throwing an instance of 'std::bad_alloc'<br>
> > what(): St9bad_alloc<br>> ><br>> > If I change the initialization line by:<br>> ><br>> > this->grid.resize(this->grid_xsize*this->grid_ysize);<br>> ><br>> > I get another message:<br>
> ><br>> > terminate called after throwing an instance of 'std::length_error'<br>> > what(): vector::_M_fill_insert<br>> ><br>> > which means that the memory allocation by the vtkstl library crashes.<br>
> > Does anybody know about this issue?<br>> ><br>> ><br>> > ________________________________<br>> > Un avatar à votre image ? Créez votre mini-moi !<br>> > _______________________________________________<br>
> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>> ><br>> > Visit other Kitware open-source projects at<br>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> ><br>> > Please keep messages on-topic and check the ParaView Wiki at:<br>> > <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>
> > <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>> ><br>> ><br><br><hr></div></div>Vous cherchez l'intégrale des clips de Michael Jackson ? <a href="http://www.bing.com/videos/search?q=Michael+Jackson&FORM=MVDE6" target="_blank">Bing ! Trouvez !</a></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br><br></div></div><hr>Achetez un nouveau PC et bénéficiez de Windows 7 dès sa sortie ! <a href="http://www.portable-windows.com/" target="_blank">En savoir plus</a></div>
</blockquote></div><br></div>