Miguel,

You swapped ':= 0' with ':= NIL', and NIL consumes
the same memory as zero, so you didn't change the
problem. You'd need ASize( ao, Len( ao ) - 1 )
(or ASize( ao, 1 ), or a simple ao var)

Brgds,
Viktor

On 2008.04.28., at 11:41, Miguel Angel Marchuet wrote:

more simple test to see the problem:

Harbour  looses 38.571 Bytes in 9.25 seconds
xHarbour looses 56.956 Bytes in 4.83 seconds

Why Harbour is more slow ?
Why xHarbour loose more memory ?

Why 2 compilers loose memory ?

Best regards,
Miguel Angel Marchuet



#include "hbmemory.ch"
#include "hbclass.ch"

#define MAXTEST 10000

PROCEDURE MAIN()
  LOCAL n, ao, nMem, nTime

  REQUEST HB_GT_WIN

  nTime := Seconds()
  nMem := Memory( HB_MEM_USED )
  ao := {}

  FOR n := 1 TO MAXTEST

     aAdd( ao, GetNew( 20, 20 ) )

     // Here harbour have a loose of performance. ????
     ao[n] := Nil

     hb_gcAll( .T. )
     ? 'Mem used -> ' + AllTrim( Str( Memory( HB_MEM_USED ) ) )

  NEXT

  ao := nil
  hb_gcAll( .T. )

? "We lost " + AllTrim( Str( Memory( HB_MEM_USED ) - nMem ) ) + " Bytes"
  ? "Elapsed time " + AllTrim( Str( Seconds() - nTime ) )

RETURN
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to