在Neo4j上增加Java堆大小

时间:2017-05-08 22:36:36

标签: java neo4j heap-size import-csv

有谁知道如何增加一个Neo4j的Java堆大小?

我正在将一个csv文件加载到Neo4j数据库中而我无法加载它,因为我需要增加Java堆大小... 我检查了我有超过100GB的免费...我也有16Gb的RAM。 我的Jar文件位于“C:\ Program Files \ Neo4j CE 3.1.4 \ bin \ neo4j-desktop-3.1.4.jar

1 个答案:

答案 0 :(得分:0)

您可以通过取消注释并设置这些行来设置位于C:\Program Files\Neo4j CE 3.1.4\conf\的neo4j.conf:

# Java Heap Size: by default the Java heap size is dynamically
# calculated based on available system resources.
# Uncomment these lines to set specific initial and maximum
# heap size.
#dbms.memory.heap.initial_size=512m
#dbms.memory.heap.max_size=512m

# The amount of memory to use for mapping the store files, in bytes (or
# kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g').
# If Neo4j is running on a dedicated server, then it is generally recommended
# to leave about 2-4 gigabytes for the operating system, give the JVM enough
# heap to hold all your transaction state and query context, and then leave the
# rest for the page cache.
# The default page cache memory assumes the machine is dedicated to running
# Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size.
#dbms.memory.pagecache.size=10g

知道如果您使用的是LOAD CSV功能,则可以使用USING PERIODIC COMMIT前缀批量处理您的交易。来自docs

的示例
USING PERIODIC COMMIT 1000
LOAD CSV FROM 'https://neo4j.com/docs/developer-manual/3.1/csv/artists.csv' AS line
CREATE (:Artist { name: line[1], year: toInt(line[2])})