Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Michael Van Canneyt
On Fri, 20 May 2016, OBones wrote: Lukasz Sokol wrote: On 20/05/16 09:40, Graeme Geldenhuys wrote: On 2016-05-20 09:36, Graeme Geldenhuys wrote: I think a “x percentage of capacity” increment is the way to go. eg: 5 or 10% Scrap that idea. In hind sight, % increments is what is causing the

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread OBones
Lukasz Sokol wrote: On 20/05/16 09:40, Graeme Geldenhuys wrote: On 2016-05-20 09:36, Graeme Geldenhuys wrote: I think a “x percentage of capacity” increment is the way to go. eg: 5 or 10% Scrap that idea. In hind sight, % increments is what is causing the problem. Regards, Graeme And actu

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Lukasz Sokol
On 20/05/16 09:40, Graeme Geldenhuys wrote: > On 2016-05-20 09:36, Graeme Geldenhuys wrote: >> I think a “x percentage of capacity” increment is the way to go. eg: 5 >> or 10% > > Scrap that idea. In hind sight, % increments is what is causing the problem. > > Regards, > Graeme And actually wh

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Graeme Geldenhuys
On 2016-05-20 09:36, Graeme Geldenhuys wrote: > I think a “x percentage of capacity” increment is the way to go. eg: 5 > or 10% Scrap that idea. In hind sight, % increments is what is causing the problem. Regards, Graeme ___ fpc-pascal maillist - f

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Graeme Geldenhuys
On 2016-05-20 07:02, LacaK wrote: > So second question is can TFPList.Expand be modified, that for large > FCapacity will be used smaller increment ? I think a “x percentage of capacity” increment is the way to go. eg: 5 or 10% Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread LacaK
What about to simply adjust Expand procedure like: if FCapacity > 8*1024*1024 then IncSize := FCapacity shr 3 else if FCapacity > 128 then IncSize := FCapacity shr 2 else if FCapacity > 8 then IncSize := 16 else IncSize := 4; SetCapacity(FCapacity + IncSize); It does not solve your prob

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: > > But of course all datastructures based on a single array (and thus inviting > > very large block allocations) are fundamentally flawed because of it in the > > first place. > > Which is why I recommended going the SAX way and store data manual

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Michael Van Canneyt
On Fri, 20 May 2016, LacaK wrote: As new nodes are appended TFPList.Expand is called And there is: if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); So if I have in list 1 000 000 items, then at once list is expanded by 250 000, which causes in one step out of memory So my question

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread LacaK
- Using SAX and not store the whole DOM in memory, and at the same time use your own memory allocation routines for your structures. Good idea. I was not aware of such option. (Unfortunatelly all work and testing on application was done, so rewrite is completelly is brrr ;-( ) Thanks for

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread LacaK
As new nodes are appended TFPList.Expand is called And there is: if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); So if I have in list 1 000 000 items, then at once list is expanded by 250 000, which causes in one step out of memory So my question is: can I somehow control increment c

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Michael Van Canneyt
On Fri, 20 May 2016, Marco van de Voort wrote: In our previous episode, LacaK said: As new nodes are appended TFPList.Expand is called And there is: if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); So if I have in list 1 000 000 items, then at once list is expanded by 250 000, which

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-20 Thread Michael Van Canneyt
On Fri, 20 May 2016, LacaK wrote: Btw is there any limit for number of memory block, which can be requested ? As far as my XML file has milions of nodes, may be that for each node is created instance of TDOMNode class (or TDOMElement I do not know), which in turn can cause that there is l

Re: [fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-19 Thread Marco van de Voort
In our previous episode, LacaK said: > As new nodes are appended TFPList.Expand is called > And there is: >if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); > > So if I have in list 1 000 000 items, then at once list is expanded by > 250 000, which causes in one step out of memory > So m

[fpc-pascal] TFPList.Expand was: Maximum of memory which can be used by single program in 32 bit Windows

2016-05-19 Thread LacaK
Btw is there any limit for number of memory block, which can be requested ? As far as my XML file has milions of nodes, may be that for each node is created instance of TDOMNode class (or TDOMElement I do not know), which in turn can cause that there is large amount of relative small memory b