Boost.PropertyTree is basically not a fast or lightweight parser.
It focuses on providing high layer convenience and functionalities, so it is not built to be efficient, I guess.
You could see this thread on boost mailing list for a similar question.
I'd suggest that an alternative of Boost.PropertyTree might be either:
- a SAX parser -- this is an another approach for XML parsing. It's like an opposite of DOM parser; it parses XML nodes one by one. Usually, the "memory allocation for entire file at the begginning" occurs in a DOM parser, but it won't occur on SAX parsers.
- an allocator-customizable parser + user defined memory pool -- you could configure the allocator of such parser to point the stable memory pool. It could simply be a large buffer of pre-allocated memory, a fragmentation-aware pool, or even a memory-mapped file, etc...