I've tested a few memory managers (MM) with tests\memtst.prg. All test is
using BCC55 compiler, singe thread application, FM statistics switched off,
2.2GHz Celeron, 256MB RAM.
Three MM were tested: BCC55, Win32 Local*(), DL MM (see:
http://gee.cs.oswego.edu/dl/html/malloc.html).
The results are:
BCC WIN DL
single large memory blocks: 1.27 1.80 2.56
many large memory blocks: 13.11 12.97 12.69
large memory block reallocation: 2.47 3.30 0.33
Very interesting. BTW this are my results for Linux with GLIBC 2.8
on Phenom 2.1Ghz:
single large memory blocks: 0.55
many large memory blocks: 3.07
large memory block reallocation: 0.07
P.S. BCC with its MM does not crash on memtst.prg!
Probably earlier memory allocation in two previous tests
changed the internal memory strategy or simply created in
memory manager enough number of memory 'wholes' that that
were used for intermediate allocations so the realloc was
always working on the same memory area only enlarging it
(no new memory was mapped after main array block).
Yes, I also think crash disappeared because of two previous test which
creates some different layout inside MM heap.
One more think I've understood after some more tests is that MM testing
could not be done in single test. Different test (or the same test in a
different memory situation can give very different results). I'll write
down a few more words about it.
I've run TaskManager to see how much memory each MM uses. I found out
that huge amount of memory is allocated by WIN MM before program exits
(on last "Press any key..." message). The exact numbers are:
BCC WIN DL
VM size before process exit (KB): 7396 72956 6702
Yes, 73MB of 256MB are occupied! The huge memory allocation is done
during the last "large memory block reallocation" test. I decided that
WIN MM is clever enough and lets a single application to allocate a huge
amount of memory, since no other applications are running (only services
and some background "startup" applications).
So, I decided to repeat the test in "high memory usage" situation. I've
run a few applications (Firefox that occupies 80MB of VM, GIMP 79MB and
Thunderbird 59MB) and repeated all test. The results was:
BCC WIN DL
single large memory blocks: 1.69 2.03 1.50
many large memory blocks: 15.09 15.17 14.13
large memory block reallocation: 2.86 3.91 0.36
VM size before process exit (KB): 8192 100024 6696
WIN MM allocates this huge mount of memory during "large memory block
reallocation" test. I was a little surprised that DL started to work
faster in "high memory usage" situation (1.5 seconds instead of 2.56).
The next surprising thing is that WIN MM allocates even more memory
100MB instead of 73MB. I've repeated last tests a few times, the results
are the same.
Best regards,
Mindaugas
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour