It is caused by (I think that stupid...) code in
glibc-2.2.4/libio/libioP.h:ALLOC_BUF(), which unconditionally does
'mmap(0, ROUND_TO_PAGE(size), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0)' instead of 'malloc(size)' when it finds that underlying system
supports malloc.
If you linked Magma yourself, try adding:
--- #include <malloc.h>void* malloc(size_t len) { return sbrk(len); } void* __mmap(void* start, size_t len, int prot, int flags, int fd, unsigned long offset) { if (start == 0 && fd == -1) { return malloc(len); } return NULL; }
--- into your project. It forces my 'void main() { printf("X\n"); pause(); }' to use brk() instead of mmap() for stdio buffers. Maybe we should move to bug-glibc instead, as there is no way to force stdio to not ignore mallopt() parameters, it still insist on using mmap, and I think that it is a glibc2.2 bug. Petr Vandrovec vandrove@vc.cvut.czP.S.: I did some testing, and about 95% of mremap() allocations is targeted to last VMA, so no VMA move is needed for them. But no Java was part of picture, only c/c++ programs I use - gcc, mc, perl. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/