Dynamic Code and Atoms

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic Code and Atoms

Vance Shipley-2
I am finding that when I dynamically build a function with
a very large number of clauses the emulator crashes while
compilig (cmpile:forms/2) after hitting the atom table limit.
Looking at a erl_crash_.dump I can see that it was filling up
the atom table with 'corN' where N is an ever increasing number.

Is this a design limitation?

--
        -Vance

Reply | Threaded
Open this post in threaded view
|

Dynamic Code and Atoms

Anthony Ramine-2
Yes and no, the atom table being limited in size is by design (cf. EEP20).

What are you compiling, though, to reach such a limit? That sounds completely insane to me.

--
Anthony Ramine

Le 23 janv. 2014 ? 15:54, Vance Shipley <vances> a ?crit :

> I am finding that when I dynamically build a function with
> a very large number of clauses the emulator crashes while
> compilig (cmpile:forms/2) after hitting the atom table limit.
> Looking at a erl_crash_.dump I can see that it was filling up
> the atom table with 'corN' where N is an ever increasing number.
>
> Is this a design limitation?
>
> --
> -Vance
> _______________________________________________
> erlang-questions mailing list
> erlang-questions
> http://erlang.org/mailman/listinfo/erlang-questions


Reply | Threaded
Open this post in threaded view
|

Dynamic Code and Atoms

Anthony Ramine-2
In reply to this post by Vance Shipley-2
Sorry I didn?t reply to all the first time, putting the list back in the loop.

Probably this problem was never encountered before. Do you really need to do whatever you are doing like this?

--
Anthony Ramine

Le 23 janv. 2014 ? 16:29, Vance Shipley <vances> a ?crit :

> I'm well aware of the limits on the atom table, how to change it and that it's not garbage collected.
>
> I'm not creating these atoms in my abstract forms. It appears to be core Erlang (cerl) which is creating atoms.
> On Jan 23, 2014 8:50 PM, "Anthony Ramine" <n.oxyde> wrote:
> Yes and no, the atom table being limited in size is by design (cf. EEP20).
>
> What are you compiling, though, to reach such a limit? That sounds completely insane to me.
>
> --
> Anthony Ramine
>
> Le 23 janv. 2014 ? 15:54, Vance Shipley <vances> a ?crit :
>
> > I am finding that when I dynamically build a function with
> > a very large number of clauses the emulator crashes while
> > compilig (cmpile:forms/2) after hitting the atom table limit.
> > Looking at a erl_crash_.dump I can see that it was filling up
> > the atom table with 'corN' where N is an ever increasing number.
> >
> > Is this a design limitation?
> >
> > --
> >       -Vance
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions
> > http://erlang.org/mailman/listinfo/erlang-questions
>


Reply | Threaded
Open this post in threaded view
|

Dynamic Code and Atoms

Vance Shipley-2
I don't necessarily need to do what I am doing, it just works quite well
... up to a point. The alternative involves a lot of list processing.
Clause head matching on the other hand is really fast. My challenge is to
match a very large number of patterns and to do it very fast and with the
lowest cost.
 On Jan 23, 2014 9:04 PM, "Anthony Ramine" <n.oxyde> wrote:

> Sorry I didn?t reply to all the first time, putting the list back in the
> loop.
>
> Probably this problem was never encountered before. Do you really need to
> do whatever you are doing like this?
>
> --
> Anthony Ramine
>
> Le 23 janv. 2014 ? 16:29, Vance Shipley <vances> a ?crit :
>
> > I'm well aware of the limits on the atom table, how to change it and
> that it's not garbage collected.
> >
> > I'm not creating these atoms in my abstract forms. It appears to be core
> Erlang (cerl) which is creating atoms.
> > On Jan 23, 2014 8:50 PM, "Anthony Ramine" <n.oxyde> wrote:
> > Yes and no, the atom table being limited in size is by design (cf.
> EEP20).
> >
> > What are you compiling, though, to reach such a limit? That sounds
> completely insane to me.
> >
> > --
> > Anthony Ramine
> >
> > Le 23 janv. 2014 ? 15:54, Vance Shipley <vances> a ?crit :
> >
> > > I am finding that when I dynamically build a function with
> > > a very large number of clauses the emulator crashes while
> > > compilig (cmpile:forms/2) after hitting the atom table limit.
> > > Looking at a erl_crash_.dump I can see that it was filling up
> > > the atom table with 'corN' where N is an ever increasing number.
> > >
> > > Is this a design limitation?
> > >
> > > --
> > >       -Vance
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questions
> > > http://erlang.org/mailman/listinfo/erlang-questions
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140123/7fe42543/attachment.html>

Reply | Threaded
Open this post in threaded view
|

Dynamic Code and Atoms

Peer Stritzinger-2
You can increase the maximum number of atoms by passing the +t option
to the emulator:

http://www.erlang.org/doc/efficiency_guide/advanced.html#atoms

Not sure how to pass emulator options to erlc but you can use something like:

erl +t <numberofatoms> -compile Mod1 Mod2

or also use -make if you want to.

Cheers,
-- Peer


On 2014-01-23 16:38:57 +0000, Vance Shipley said:

> I don't necessarily need to do what I am doing, it just works quite
> well ... up to a point. The alternative involves a lot of list
> processing. Clause head matching on the other hand is really fast. My
> challenge is to match a very large number of patterns and to do it very
> fast and with the lowest cost.
> On Jan 23, 2014 9:04 PM, "Anthony Ramine" <n.oxyde> wrote:
> Sorry I didn?t reply to all the first time, putting the list back in the loop.
>
> Probably this problem was never encountered before. Do you really need
> to do whatever you are doing like this?
>
> --
> Anthony Ramine
>
> Le 23 janv. 2014 ? 16:29, Vance Shipley <vances> a ?crit :
>
> > I'm well aware of the limits on the atom table, how to change it and
> that it's not garbage collected.
> >
> > I'm not creating these atoms in my abstract forms. It appears to be
> core Erlang (cerl) which is creating atoms.
> > On Jan 23, 2014 8:50 PM, "Anthony Ramine" <n.oxyde> wrote:
> > Yes and no, the atom table being limited in size is by design (cf. EEP20).
> >
> > What are you compiling, though, to reach such a limit? That sounds
> completely insane to me.
> >
> > --
> > Anthony Ramine
> >
> > Le 23 janv. 2014 ? 15:54, Vance Shipley <vances> a ?crit :
> >
> > > I am finding that when I dynamically build a function with
> > > a very large number of clauses the emulator crashes while
> > > compilig (cmpile:forms/2) after hitting the atom table limit.
> > > Looking at a erl_crash_.dump I can see that it was filling up
> > > the atom table with 'corN' where N is an ever increasing number.
> > >
> > > Is this a design limitation?
> > >
> > > --
> > > ? ? ? -Vance
> > > _______________________________________________
> > > erlang-questions mailing list
> > > erlang-questions
> > > http://erlang.org/mailman/listinfo/erlang-questions
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140131/c1e7a137/attachment.html>