java.lang.OutOfMemoryError: GC overhead limit exceeded

996 views
Skip to first unread message

sidra...@pucit.edu.pk

unread,
Feb 27, 2017, 5:28:07 AM2/27/17
to PSL Users
My code is running fine over a small dataset (a few hundred instances) but throwing me exception for a little bigger dataset (4k instances) during learning phase. I tried to resolve but did not work. Can any one please tell me what can be the possible issues or remedies?

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421)
at java.lang.StringBuilder.append(StringBuilder.java:136)
at java.lang.StackTraceElement.toString(StackTraceElement.java:172)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at java.lang.Throwable.printStackTrace(Throwable.java:658)
at java.lang.Throwable.printStackTrace(Throwable.java:721)
at org.h2.jdbc.JdbcSQLException.printStackTrace(JdbcSQLException.java:91)
at org.h2.message.TraceSystem.writeFile(TraceSystem.java:267)
at org.h2.message.TraceSystem.write(TraceSystem.java:238)
at org.h2.message.Trace.error(Trace.java:167)
at org.h2.message.TraceObject.logAndConvert(TraceObject.java:412)
at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1110)
at edu.umd.cs.psl.database.rdbms.RDBMSDatabase.executePendingStatements(RDBMSDatabase.java:534)
at edu.umd.cs.psl.database.rdbms.RDBMSDatabase.executeQuery(RDBMSDatabase.java:556)
at edu.umd.cs.psl.application.learning.weight.TrainingMap.<init>(TrainingMap.java:98)
at edu.umd.cs.psl.application.learning.weight.WeightLearningApplication.initGroundModel(WeightLearningApplication.java:134)
at edu.umd.cs.psl.application.learning.weight.WeightLearningApplication.learn(WeightLearningApplication.java:117)
at edu.umd.cs.psl.application.learning.weight.WeightLearningApplication$learn.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at eis.iai.uni.bonn.de.RunInference.learn(RunInference.groovy:89)
at eis.iai.uni.bonn.de.RunInference$learn.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at eis.iai.uni.bonn.de.SyncManager.run(SyncManager.groovy:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Exception in thread "Thread-0" java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0"

I. Beltagy

unread,
Feb 27, 2017, 1:41:32 PM2/27/17
to sidra...@pucit.edu.pk, PSL Users
How do your rules look like ? are they very long ?

--
You received this message because you are subscribed to the Google Groups "PSL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psl-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I. Beltagy

unread,
Feb 27, 2017, 3:14:49 PM2/27/17
to Sidra Aslam, PSL Users
This could be the problem. You know that the memory required to ground a rule is exponential in number of variables of the rule, in this case, 7. Try to estimate the memory requirements for your ground network, and see if it fits in memory or not. If not, you will need to rethink your rules to make them shorter (in terms of number of variables) so that they use less memory. 

PS: This answer is based on my experience with PSL v1.1. It might be the case that it doesn't apply to the recent v1.2.1.

On Mon, Feb 27, 2017 at 11:33 AM Sidra Aslam <sidra...@pucit.edu.pk> wrote:
Yes, e.g. largest of them looks like

m.add rule : (sub_propertyOf(A,B, UID) & fromDataset(S, B, P) & fromConsumer1(S, A, N) & fromConsumer2(S, A, O) & nrepeat(A,B) & nsame(N,O)) >> relatedTo(S, A, P), weight : weightMap["sp1"];

Qifang Zhao

unread,
Feb 28, 2017, 9:28:44 AM2/28/17
to PSL Users, sidra...@pucit.edu.pk
Hi Sidra Aslam,

May I know how can you define a predicate with 3 arguments?

Because when I try to define such kind of predicate, it throws error that "Currently DomainRangeConstrantKerneks only support binary predicates."

Thank you.

Regards,
Qifang/James

Eriq Augustine

unread,
Feb 28, 2017, 11:15:02 AM2/28/17
to Qifang Zhao, PSL Users, sidra...@pucit.edu.pk
Hey Qifang,

You can have predicates with an arbitrary number of arguments greater than zero.
The error you are getting is because constraints only support binary predicates.

Imagine the functional constraint, where the sum of all ground atoms that start with the same value is one.
This makes sense with a binary predicate: the LHS is the domain and the RHS is the range.
However, the behavior would be ambiguous with predicates with more than two arguments.

If we have the predicate FOO(A, B, C) and try to put a functional constraint on it.
The following domain/range combinations could all be reasonable:
  • A -> (B, C)
  • (A, B) -> C
  • A -> C
  • B -> C
Since the situation is ambiguous, we don't allow predicate constraints with non-binary predicates.
As an aside, PSL 2.0 does constraints differently and supports constraints on non-binary predicates.

-eriq

--
You received this message because you are subscribed to the Google Groups "PSL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psl-users+unsubscribe@googlegroups.com.
Message has been deleted

Qifang Zhao

unread,
Feb 28, 2017, 7:34:27 PM2/28/17
to PSL Users
Hi Eriq,

Thx for the explanation:)

Regards,
Qifang

Reply all
Reply to author
Forward
0 new messages