Announcement Announcement Module
Collapse
No announcement yet.
Spring Data - MongoDB - java.lang.OutOfMemoryError: Java heap space Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data - MongoDB - java.lang.OutOfMemoryError: Java heap space

    Hi,

    Was playing around with Spring Data and Mongo DB. I want to store a KML file (see below) using Java API for KML. I do this by simply unmarshaling the XML into an object and pass this to Spring Data. There seems to be some infinite recursion happening:

    Code:
    java.lang.OutOfMemoryError: Java heap space
    	at sun.reflect.ConstantPool.getUTF8At0(Native Method)
    	at sun.reflect.ConstantPool.getUTF8At(ConstantPool.java:35)
    	at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:180)
    	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
    	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
    	at java.lang.reflect.Field.declaredAnnotations(Field.java:1014)
    	at java.lang.reflect.Field.getAnnotation(Field.java:1000)
    	at org.springframework.data.mapping.BasicMappingContext.isTransient(BasicMappingContext.java:371)
    	at org.springframework.data.mapping.BasicMappingContext.isPersistentProperty(BasicMappingContext.java:287)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:156)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)
    	at org.springframework.data.mapping.BasicMappingContext.addPersistentEntity(BasicMappingContext.java:151)
    	at org.springframework.data.mapping.BasicMappingContext$1.doWith(BasicMappingContext.java:172)
    	at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:513)

    Would someone create JIRA ticket for this (or tell me how I can get access)?

    Thanks
    Patrick

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <kml xmlns="http://www.opengis.net/kml/2.2" >
        <Placemark>
            <name>Java User Group Hessen - JUGH!</name>
            <visibility>true</visibility>
            <open>false</open>
            <description>die Java User Group Hessen [...]</description>
            <styleUrl>styles.kml#jugh_style</styleUrl>
            <Point>
                <extrude>false</extrude>
                <altitudeMode>clampToGround</altitudeMode>
                <coordinates>9.444652669565212,51.30473589438118</coordinates>
            </Point>
        </Placemark>
    </kml>

  • #2
    More interesting than the XML/KML is how does the object look like?

    You get access to JIRA by registering.

    Comment


    • #3
      Originally posted by Matthias S. View Post
      More interesting than the XML/KML is how does the object look like?
      Right, here you go: http://code.google.com/p/javaapifork...2_2_0/Kml.java

      Also, you could checkout my complete project to reproduce:
      https://github.com/patman42/Spring-J.../javaapiforkml

      You get access to JIRA by registering.
      Thanks, had some issues yesterday but today it worked. Should I create a ticket referencing this post?

      Comment


      • #4
        How much heap space is available?
        Have you tried using xml configuration?

        I think the object might be to complex, with references to interfaces and so on. But it could also be a bug, i don't see a reason why non spring-data annotations should be processed.

        Comment

        Working...
        X