How to use large pages for C++ objects?

Discussion created by edward_yang on May 1, 2009
Latest reply on Jun 19, 2009 by edward_yang
edited from a previous question

Is there a way that I can easily use the large pages to store a large data structure consisting of C++ objects, such as maps and deque? The method described in the following page does not seem to work with C++ stdlib objects. (Or does it?)


The data structure in question has multiple (many) such objects organized in a graph. There can be > 4million of nodes and >2GB memory used. I noticed that whenever the data structure contains more than 200k nodes,  or the total memory usage more than a few hundred MBs, manipulating the graph becomes very slow with a lot of page faults.

The ability to use large pages (2MB, 4MB or even 1GB) because very attractive here. I'd like to know if there's an easy way to do it. I suppose it's possible to rewrite the member functions in the stdlib classes involving memory allocations, but doing so is too much hassle and alternative ways are highly desired. Thanks.