On Thu, Feb 2, 2012 at 9:09 AM, Yang <[email protected]> wrote:
>
>
>
> Thanks for the clarification.
>
>
> I had 1mil features that I want to parse out of a DB and write into a shape
> file, my first naive implementation was to read all 1mil into one
> featureCollection, then start a dataStore, and do
> dataStore.addFeatures(collection)
>
> but that ran into OutOfHeap exception, since the 1mil features took up too
> much mem.
> then I tried reading out 1000 features at at time, and put them into a
> smaller feature collection, add the small feature collection into the
> dataStore. ----- but according to what you said, this does not make it any
> better, right? whenever a new featureCollection is added, it would have to
> pull out the entire existing dataStore contents, and rewrite it? so still
> the same memory for 1mil features will be needed?

If you need to write one million features, and my memory serves me right,
your best bet is to get a FeatureWriter out of the DataStore and use that one,
it should stream out directly to disk

Cheers
Andrea

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to