Memory error over 4M bytes in pyjsbuild

25 views
Skip to first unread message

wb

unread,
Nov 28, 2015, 4:20:51 AM11/28/15
to Pyjs.org Users
Hi, 

I encountered an Memory Error while running pyjsbuild to translate python source.  The source code contains about 40000 dict entries (total 4 Mega bytes).  The memory usage soars above 3 Giga bytes right before the error.

I tried to change the dict (data={a:b, c:d, ...})  to tuple initialization (data=dict([(a,b), (b,c), ...])). But no difference on the memory error.  

I tried to use list instead of dict (data=[(a,b), (c,d), ...]), No difference again

And, I tried to split the dict into small dicts.  But no difference again.

data={a:b}
data.update({c:d})
data.update({e:f})
...
 
It seems that the memory error is not specific to dict type, but dependent on source size itself. Is there source size limit on pyjsbuild? is there a way to translate python source over 4 M bytes?

Thanks.

wb

unread,
Nov 28, 2015, 6:19:50 AM11/28/15
to Pyjs.org Users
Interestingly, no error is raised when the data is in a string

data='{a:b, c:d, ...}'

It seems that the error is dependent on the number of language elements that Pyjs translator recognizes rather than the source size
 
Thanks again.
Reply all
Reply to author
Forward
0 new messages