![]() |
| | #1 |
| Registered User Join Date: Mar 2010
Posts: 18
| libxml++ memory usage while opening a ~50MB file, libxml++ used ~1.5GB RAM, which I find somewhat excessive. Is this an error in my usage (i.e., did I forget to set some hidden "don't waste memory"-flag?) or is this problem known for libxml++? If so, can you recommend another portable (Linux, BSD, Windows) xml parser? Thanks in advance! |
| assertion is offline | |
| | #2 |
| Registered User Join Date: Dec 2009 Location: Henderson, NV
Posts: 887
| Well one really tiny library that I use a lot and love for the simplicity as well as how much control you get over how much "library" you end up with is TinyXml Main Page. Tiny XML has hooks for C and C++, is (or was last time I downloaded it) only 5 small source files in size and is easy to use/get up to speed with. It is non-validating, be warned but sometimes you don't care and just want a quick and dirty XML parser/generator. Best of all it works on all platforms. As for the memory usage it is probably all of the trees that get built when most parsers tear into a file. 50mb seems a little heavy for XML but you must have your reasons...I think the largest I ever did was about 20mb but that was mostly binary data... Last edited by jeffcobb; 03-19-2010 at 12:48 PM. Reason: Spelling; what I get for posting pre-caffeination.. |
| jeffcobb is offline | |
| | #3 |
| and the hat of Destiny Join Date: Aug 2001 Location: The edge of the known universe
Posts: 22,495
| > or is this problem known for libxml++? libxml++ Maybe there is a bug filed already. On which OS did you do your test, and how did you determine how much memory was used? Have you tried smaller XML files - do your results scale? For a list of parsers XML Parsers |
| Salem is offline | |
| | #4 |
| Registered User Join Date: Mar 2010
Posts: 18
| Thanks for your fast replies. I'll have a look at Tiny xml. I don't really need xml, but I like the format for its extensibility and readability (plus, it is known by about everyone dealing with those computer thingies). I use it for big graphs (>10^7 edges). Memory usage was estimated on a Debian system with a Linux 2.6 kernel, with "top" (so it isn't accurate at all), but when reading a simple edge list via ifstream, memory usage decreased by 1.5 GB (and the process didn't say good-by via SIGTERM for the 60MB file...). Memory usage seems to be linearly dependent on file size. Anyways, thanks again for your help. |
| assertion is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tools for finding memory leaks | stanlvw | C++ Programming | 4 | 04-03-2009 11:41 AM |
| Problems with shared memory shmdt() shmctl() | Jcarroll | C Programming | 1 | 03-17-2009 10:48 PM |
| how much memory usage for my program? | elninio | Linux Programming | 4 | 08-01-2008 03:58 PM |
| Structs vs. Classes, Memory Usage | CrazyNorman | Game Programming | 2 | 07-17-2005 05:43 PM |
| Memory Usage | ghe1 | Linux Programming | 0 | 03-18-2002 09:43 AM |