On 05/18/2012 03:38 PM, Arnaud Versini wrote:
I checked on Linux and Windows, the memory after a massive allocation
and a massive deallocation is really freed, so currently la raison
d'ĂȘtre of our internal allocator is gone (need to be checked on Mac Os
X). About performance I don't know.

Indeed, on Fedora 16 at least,

$ cat test.cc
#include <iostream>
#include <string>
int main() {
    char * p[100000];
    for (int i = 0; i != 100000; ++i) p[i] = new char[10000];
    std::cout << "...";
    std::cin.ignore();
    for (int i = 0; i != 100000; ++i) delete p[i];
    std::cout << "...";
    std::cin.ignore();
}
$ g++ test.cc
$ ./a.out

and "pmap ... | grep total" at the two checkpoints reveals a shrink-again allocation mechanism (from 990752K back to 12736K here).

Stephan
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to