[erlang-questions] xmerl producing atoms
Willem de Jong
Tue Mar 13 21:07:29 CET 2007
Maybe you can use the sax parser that is part of Erlsom. It wouldn't be
difficult to implement a call-back function that produces output similar or
the xmerl 'simple-form', or calls a function similar to the 'hook_fun'. The
sax parser does not create any atoms.
On 3/13/07, igwan <igwan@REDACTED> wrote:
> Dear list,
> I'm currently working on a system that parses user-provided XML data
> using xmerl. What I find is a problem is that xmerl produces new atoms
> for every element name or namespace URI it parses from the input. This
> is not a big deal if you work with a limited number of schemas and
> "internal" users, but when you have to accept input from the internet,
> your node could be quickly taken down by filling up the atom table. The
> documentation ("Efficiency Guide" / 7.1 "Memory") says that atoms are
> not garbage-collected.
> I came to another post from 2005 describing this issue :
> I have looked at alternative parsers like ErlSom, but it seems to work
> against a pre-compiled schema and for my application, I have to accept
> any XML document, without knowing its structure. Plus, I make heavy use
> of hook_fun in xmerl_scan.
> My questions : Is there a (possibly-undocumented) option for telling
> xmerl to produce binaries or strings instead of atoms ? Or are there
> plans to garbage-collect atoms in the near future ?
> Thanks in advance,
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions