Out of Memory Error

37 views
Skip to first unread message

br8kpoint

unread,
Feb 24, 2012, 10:17:36 AM2/24/12
to neo4jrb
I have a model that I cannot list through the all method. I can access
the index page if there are no models that exist but when even one
model exists I get an Java::JavaLang::OutOfMemoryError (Java heap
space): I have traced this down into the execution of the _all rule
that neo4jrb sets up but I don't know enough to trace it further.
Below is the console output and the model definition. Any help would
be greatly appreciated.


Started GET "/page_templates" for 127.0.0.1 at Fri Feb 24 10:06:03
-0500 2012
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Processing by
PageTemplatesController#index as HTML
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Portal Load (1.0ms)
SELECT `portals`.* FROM `portals` WHERE `portals`.`host` = 'localhost'
LIMIT 1
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Rendered
page_templates/index.html.erb within layouts/jim/application
(30790.0ms)
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Completed 500 Internal
Server Error in 45171ms
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1]
Java::JavaLang::OutOfMemoryError (Java heap space):
java.nio.HeapCharBuffer.<init>(HeapCharBuffer.java:57)
java.nio.CharBuffer.allocate(CharBuffer.java:329)
java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:792)
java.nio.charset.Charset.decode(Charset.java:791)
org.jruby.RubyEncoding.decode(RubyEncoding.java:198)
org.jruby.RubyString.decodeString(RubyString.java:695)
org.jruby.RubyString.toString(RubyString.java:671)
java.lang.String.valueOf(String.java:2838)
java.lang.StringBuilder.append(StringBuilder.java:132)
org.jruby.RubyBasicObject.inspectObj(RubyBasicObject.java:1109)
org.jruby.RubyBasicObject.hashyInspect(RubyBasicObject.java:1080)
org.jruby.RubyBasicObject.inspect(RubyBasicObject.java:1059)
org.jruby.RubyKernel.inspect(RubyKernel.java:1978)
sun.reflect.GeneratedMethodAccessor324.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
java.lang.reflect.Method.invoke(Method.java:616)

org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:
146)

org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:
203)

org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:
199)
org.jruby.RubyClass.finvoke(RubyClass.java:632)
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:
545)
org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:353)
org.jruby.RubyBasicObject.inspectObj(RubyBasicObject.java:1109)
org.jruby.RubyBasicObject.hashyInspect(RubyBasicObject.java:1080)
org.jruby.RubyBasicObject.inspect(RubyBasicObject.java:1059)
org.jruby.RubyKernel.inspect(RubyKernel.java:1978)
sun.reflect.GeneratedMethodAccessor324.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
java.lang.reflect.Method.invoke(Method.java:616)

org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:
146)

org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:
203)

org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:
199)


[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Rendered /home/mike/
Aptana Studio 3 Workspace/shindig/java/server/src/main/webapp/WEB-INF/
lib/jruby/1.8/gems/actionpack-3.2.1/lib/action_dispatch/middleware/
templates/rescues/_trace.erb (7.0ms)
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Rendered /home/mike/
Aptana Studio 3 Workspace/shindig/java/server/src/main/webapp/WEB-INF/
lib/jruby/1.8/gems/actionpack-3.2.1/lib/action_dispatch/middleware/
templates/rescues/_request_and_response.erb (8.0ms)
[09a49db7f92bb1ee220d3324e9bcc410] [127.0.0.1] Rendered /home/mike/
Aptana Studio 3 Workspace/shindig/java/server/src/main/webapp/WEB-INF/
lib/jruby/1.8/gems/actionpack-3.2.1/lib/action_dispatch/middleware/
templates/rescues/diagnostics.erb within rescues/layout (137.0ms)

class PageTemplate < Neo4j::Rails::Model

property :name
property :description
property :json_template
property :owner_type
property :created_at
property :updated_at

index :name, :type => :fulltext
index :description, :type => :fulltext

has_n(:networks).to(Network)
has_n(:apps).to(App)

end

Peter Neubauer

unread,
Feb 24, 2012, 1:41:51 PM2/24/12
to neo...@googlegroups.com

How big is the result you are expecting? Might be that there is a large collection being populated?

Sent from a device with crappy keyboard and autocorrection.

/peter

--
You received this message because you are subscribed to the Google Groups "neo4jrb" group.
To post to this group, send email to neo...@googlegroups.com.
To unsubscribe from this group, send email to neo4jrb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en.

Andreas Ronge

unread,
Feb 26, 2012, 12:30:43 AM2/26/12
to neo...@googlegroups.com
Hi

How can I reproduce this error ?
What does the controller code look like ?
Are you trying to get all the PageTemplate in the controller action ?
If you are, how many PageTemplate nodes are there ?

Cheers
Andreas

br8kpoint

unread,
Feb 27, 2012, 8:41:09 AM2/27/12
to neo4jrb
Problem solved. Turned out to be an inadvertent recursion issue.
Thanks.
Reply all
Reply to author
Forward
0 new messages