I have written a converter that takes openstreetmap xml files and converts them to a binary runtime rendering format that is typically about 10% of the original size. Input file
Have you checked to ensure you aren't leaking memory anywhere?
Since your program is portable to Linux, I suggest running it under Valgrind to make sure.