Out of memory

14 views
Skip to first unread message

Tim Hinrichs

unread,
Feb 3, 2010, 12:38:55 PM2/3/10
to hampi...@googlegroups.com
Some more odd (?) behavior. The following input file causes Hampi to
run out of memory. The string I'm asking for is fairly long, and
the number of characters is large, but the regular language includes
a single string.

var string:75;
cfg q2 := \104 \116 \116 \112 \058 \047 \047 \057 \056;
cfg q3 := \046;
cfg q4 := \049 \051 \048;
cfg q5 := \046;
cfg q6 := \050 \052 \057;
cfg q7 := \046;
cfg q8 := \053 \055 \047 \098 \050 \101 \118 \111 \108 \117 \116 \105
\111 \110 \047 \097 \100 \109 \105 \110;
cfg q9 := \046;
cfg q10 := \112 \104 \112;
cfg q11 := \063;
cfg q12 := \099 \116 \114 \108 \061 \105 \116 \101 \109 \115 \038
\102 \105 \108 \116 \101 \114 \061 \114 \101 \115 \116 \111 \114 \101
\038 \098 \108 \111 \103 \061 \049;
cfg q1 := q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12;
cfg flax0 := q1;

assert string in flax0;


Tim


java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.toArray(ArrayList.java:275)
at java.util.ArrayList.addAll(ArrayList.java:472)
at hampi.utils.PigeonHoleDistributor.distribute2
(PigeonHoleDistributor.java:212)
at hampi.utils.PigeonHoleDistributor.distribute2
(PigeonHoleDistributor.java:208)
at hampi.grammars.apps.GrammarStringBounder.distributions
(GrammarStringBounder.java:164)
at
hampi.grammars.apps.GrammarStringBounder.internalGetBoundedRegexp
(GrammarStringBounder.java:74)
at
hampi.grammars.apps.GrammarStringBounder.internalGetBoundedRegexp
(GrammarStringBounder.java:120)
at hampi.grammars.apps.GrammarStringBounder.getBoundedRegexp
(GrammarStringBounder.java:54)
at hampi.parser.HConstraintPreparer.prepareSizeFixRegexp
(HConstraintPreparer.java:216)
at hampi.parser.HConstraintPreparer.prepareIn
(HConstraintPreparer.java:132)
at hampi.parser.HConstraintPreparer.prepare
(HConstraintPreparer.java:47)
at hampi.parser.HConstraintPreparer.prepare
(HConstraintPreparer.java:34)
at hampi.Hampi.run(Hampi.java:283)
at hampi.Hampi.run(Hampi.java:259)
at hampi.Hampi.main(Hampi.java:238)

Adam Kiezun

unread,
Feb 3, 2010, 1:20:02 PM2/3/10
to hampi...@googlegroups.com
Hi Tim,
You've hit a good case where we could definitely do a *much* better
job in grammar bounding. All these sizes are fixed so there's no
excuse for not breezing through the computation. I'll look into it. I
created a bug report
(http://code.google.com/p/hampi/issues/detail?id=3)

./adam

> hampi.parser.HConstraintPreparer.prepare(HConstraintPreparer.java:34)

Reply all
Reply to author
Forward
0 new messages