Reputation: 1012
I have a Vertex node entity which has a List of relationships.
@NodeEntity (label="User")
public class Vertex {
private Long id;
private String name;
@Index(unique=true)
private String email;
@Relationship(type="WORKS_WITH", direction = Relationship.OUTGOING)
private List<Edge> teammates;
..
}
@RelationshipEntity(type = "WORKS_WITH")
public class Edge {
@GraphId
private Long relationshipId;
@Property
private double weight;
@StartNode
private Vertex src;
@EndNode
private Vertex dest;
}
I have a Spring Boot application and I am using spring-data-neo4j (4.0.0) with a local neo4j server. When I save a Vertex object with 3-10 edges in the edges list it works well. If the edges list becomes larger (up to 20-30 edge objects), the application fails to save the vertex. I save the vertex using the GraphRepository from org.springframework.data.neo4j:
vertexRepository.save(vertex);
I have left all the tunning parameters as default since I am not saving large amounts of data yet. I have set the size of the memory pool and permanent generation space to:
export JAVA_OPTS="-Xmx256M -XX:MaxPermSize=512M"
In the messages log I get:
2016-05-31 12:12:06.592+0000 WARN [o.n.k.i.c.MonitorGc] GC Monitor: Application threads blocked for 327ms.
2016-05-31 12:12:08.256+0000 WARN [o.n.k.i.c.MonitorGc] GC Monitor: Application threads blocked for 260ms.
2016-05-31 12:12:09.915+0000 WARN [o.n.k.i.c.MonitorGc] GC Monitor: Application threads blocked for 258ms.
2016-05-31 12:12:12.690+0000 WARN [o.n.k.i.c.MonitorGc] GC Monitor: Application threads blocked for 269ms.
The Neo4j Documentation suggests that for 2 Million Nodes you need 512Mb of Heap so that would suffice for my case.
My machine is a Google Compute Engine Instance: custom (2 vCPUs, 8 GB memory). What could be the problem here?
Upvotes: 2
Views: 993