realloc+write benchmark
Radim Kolar
hsn at netmag.cz
Fri Jan 23 16:06:35 CET 2004
zmenil jsem benchmark tak, aby se do alokovane pameti zapisovalo,
kdyz se nezapisovalo linux skoncil vzdy s nulou. Linux2.4 se i pri
overcommit memory tvaril jako ze naalokoval 1GB pameti na Pentiu s
32 MB bez swapu, pri pokusu o pristup do te pameti killnul proces.
nove vysledky jsou nasledujici:
FreeBSD 5.2
(hsn at ttyv0):~/forkbomb% time ./forkbomb -l 32 -i 256 -M --quit
Safety alarm at 300 sec. enabled.
Actions: alloc 32 MB (step 1024 kB) and touch it.
Forkbomb 1.2 started.
./forkbomb -l 32 -i 256 -M --quit 4.58s user 5.28s system 74% cpu 13.159 total
linux2.4+glib2.3
Safety alarm at 300 sec. enabled.
Actions: alloc 32 MB (step 1024 kB) and touch it.
Forkbomb 1.2 started.
./forkbomb -l 32 -i 256 -M --quit 0.00s user 0.30s system 107% cpu 0.280 total
docela hezky rozdil, coz?
1) Linux ma mremap syscall, ktery pouziva pro realokaci velkych bloku bez
jejich kopirovani
2) FreeBSD memory allocator nepozna ze realokovany blok je posledni
a staci tedy udelat brk() pro jeho zvetseni. Nechtel by to tam nekdo
dopsat? realloc funkce ma jen 2 stranky....
muj bugreport byl zamitnut s:
State-Changed-From-To: open->closed
State-Changed-By: phk
State-Changed-Why:
You seem to be confused as to what responsibilities the programmer
has when it comes to practicing sensible memory management.
More information about the Users-l
mailing list