|
|
Fast XML reader?
I have some very large XML files, up to 10mB each, that I need to read into Matlab structures. I have tried the native xmlread and several other XML readers / parsers posted on Matlab Central's File Exchange. They all work OK but have yet to find a function that can do it without taking minutes per file. Anyone run across a fast(er) XML reader function?
|
|
0
|
|
|
|
Reply
|
Steven
|
6/10/2010 6:41:07 PM |
|
I have some large XML files which are 15MB or more... in this case I get an error:
java.lang.OutOfMemoryError: Java heap space
So I am also in need of a better XML reader/parser. Particularly one that is more memory efficient. Is there something in the java libraries that I can use?
|
|
0
|
|
|
|
Reply
|
Scott
|
10/18/2010 5:16:05 PM
|
|
Scott <cogan@ge.com> wrote:
>
> So I am also in need of a better XML reader/parser. Particularly one
> that is more memory efficient. Is there something in the java libraries
> that I can use?
If you are after speed and memory efficiency, rather than flexibility,
perhaps you should strip the XML tags from the file using sed / awk / perl,
to end up with a simple text file.
What does you XML file look like?
--
Dr Tristram J. Scott
Energy Consultant
|
|
0
|
|
|
|
Reply
|
tristram
|
10/19/2010 10:05:09 AM
|
|
On Oct 18, 1:16=A0pm, "Scott " <co...@ge.com> wrote:
> I have some large XML files which are 15MB or more... in this case I get =
an error:
> java.lang.OutOfMemoryError: Java heap space
>
> So I am also in need of a better XML reader/parser. =A0Particularly one t=
hat is more memory efficient. =A0Is there something in the java libraries t=
hat I can use?
You don't say what platform you are on (I've only tried the following
under Linux). The MATLAB program looks for a java.opts in your startup
directory. You can put the -Xms and -Xmx options like below which set
the minimum java heap size and the maximum (values are in bytes).
-Xms16777216
-Xmx1073741824
Every time more java heap space is required, I believe it tries to
double the current size. You can check some of these values from
within MATLAB using:
java.lang.Runtime.getRuntime.maxMemory
java.lang.Runtime.getRuntime.totalMemory
java.lang.Runtime.getRuntime.freeMemory
Chris
|
|
0
|
|
|
|
Reply
|
cchgroupmail (819)
|
10/19/2010 11:10:50 AM
|
|
|
3 Replies
618 Views
(page loaded in 0.055 seconds)
|
|
|
|
|
|
|
|
|