On Thu, 16 Apr 2009, Rossine wrote:
Hi,
> I include in my compilation of the flow "set HB_USER_CFLAGS=-DHB_GC_AUTO",
> down again harbour svn (10873) and generated again, but see the example
> below:
[...]
> ...still consuming memory in these lines:
> [CODE]
> @11, 01 say "1001 = Memory used (bytes) " + str(
> memory( HB_MEM_USED ) )
> @12, 01 say "1002 = Maximum memory used (bytes) " + str(
> memory( HB_MEM_USEDMAX ) )
> [ENDCODE]
> Harbor me when I'm compiling this line appears. She is right?
Yes, but when the total memory usage reach some limit then GC is automatically
activated.
In my Linux box the maximal memory used (1002) reach 5793595 and
current memory usage is between ~200000 and 5793595.
The GC is automatically activated ~ once per 100000 loops.
F.e.:
1001 = Memory used (bytes) 436835
1002 = Maximum memory used (bytes) 5793595
This is expected behavior.
If your GT driver is slow and you have to wait long time for 100000
iterations then I suggest to use dispbegin()/dispend() in main loop, f.e.:
[...]
while .t.
b += 1
dispbegin()
VER_MEMO()
@22 , 01 say b
dispend()
a:={nil}
a[1]:=a
[...]
It should give noticeable speed improvement.
You can also comment some lines VER_MEMO() and leave only:
@11, 01 say "1001 = Memory used (bytes) " + str(
memory( HB_MEM_USED ) )
@12, 01 say "1002 = Maximum memory used (bytes) " + str(
memory( HB_MEM_USEDMAX ) )
to reduce the cost of single loop a little bit more.
The idea is to execute GC automatically but quite seldom to not reduce
the overall performance. If not necessary do not execute it at all.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour