Hi Kostik,

On Wed, 23 Nov 2011, 11:22+0400, Maxim Konovalov wrote:

> [...]
> > Anyway, the patch needs testers before I will push it forward.
> >
> [igor's email was corrected]
>
> We will test it in out environment and let you know.
>
It seems I don't understand how it works.

Here is a test program: http://maxim.int.ru/stuff/malloc_test.c.txt

It allocates successfully 64x1MB chunks by malloc(), reallocf() and
realloc() with the following command line:

MALLOC_OPTIONS=JM limits -d 10m ./malloc_test

When we add L flag to the MALLOC_OPTIONS it starts to work strange:

It allocates 64MB via malloc() but fails to allocate more than 3MB by
realloc() and reallocf().

More funny, the result varies from time to time:

$ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head
RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760
1th allocation failed
2th allocation failed
3th allocation failed
4th allocation failed
5th allocation failed
6th allocation failed
7th allocation failed
8th allocation failed
9th allocation failed
$ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head
RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760
1048576 bytes successfuly allocated
2097152 bytes successfuly allocated
3145728 bytes successfuly allocated
4194304 bytes successfuly allocated
5242880 bytes successfuly allocated
6291456 bytes successfuly allocated
7340032 bytes successfuly allocated
8388608 bytes successfuly allocated
9437184 bytes successfuly allocated
$ MALLOC_OPTIONS=JML limits -d 10m ./malloc_test | head
RLIMIT_DATA: rlim_cur is 10485760, rlim_max is 10485760
1th allocation failed
2th allocation failed
3th allocation failed
4th allocation failed
5th allocation failed
6th allocation failed
7th allocation failed
8th allocation failed
9th allocation failed

It's today -current with your patch.

-- 
Maxim Konovalov
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to