java 实例化耗时,Java 实例化graphDb数据库实例耗时问题

2022-06-23 00:00:00 数据库 专区 订阅 付费 开启

我现在的数据库文件夹是16.2G,用的电脑win7 64位,内存16G,neo4j.conf里面的两个参数设置如下:

dbms.memory.heap.initial_size=1024m

dbms.memory.heap.max_size=6000m

现在单纯的开启neo4j服务是可以的,但是在eclipse里面通过上面的方式实例化数据库就会抛出异常,eclipse.ini里面设置的

-Xms1024m -Xmx7000m,

at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:199)

at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:130)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:101)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$0(GraphDatabaseFactory.java:89)

at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:66)

at seu.lxm.neo4j.cube.LevelSG.

at seu.lxm.neo4j.cube.LevelSG.main(LevelSG.java:493)

Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component ‘org.neo4j.kernel.recovery.Recovery@ceba2c1’ failed to initialize. Please see the attached cause exception “GC overhead limit exceeded”.

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:415)

at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:62)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:98)

at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:525)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)

at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)

at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:195)

… 7 more

Caused by: org.neo4j.kernel.api.exceptions.TransactionApplyKernelException: Failed to apply transaction: Transaction #13530 at log position LogPosition{logVersion=39, byteOffset=124530012} {started 2017-10-15 02:23:32.897+0000, committed 2017-10-15 02:23:33.286+0000, with 79351 commands in this transaction, authored by -1, with master id -1, lock session -1, latest committed transaction id when started was 13529, additional header bytes:

4E

6C

2C

3F

B3

F0

21

BC}

at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.apply(RecordStorageEngine.java:358)

at org.neo4j.kernel.recovery.DefaultRecoverySPI.lambda$startRecovery$0(DefaultRecoverySPI.java:94)

at org.neo4j.kernel.impl.api.TransactionQueue.empty(TransactionQueue.java:67)

at org.neo4j.kernel.recovery.DefaultRecoverySPI.allTransactionsRecovered(DefaultRecoverySPI.java:112)

at org.neo4j.kernel.recovery.Recovery.init(Recovery.java:109)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:405)

… 16 more

Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded

at org.neo4j.kernel.impl.locking.AbstractLockService.lock(AbstractLockService.java:63)

at org.neo4j.kernel.impl.locking.AbstractLockService.acquireNodeLock(AbstractLockService.java:52)

at org.neo4j.kernel.impl.locking.ReentrantLockService.acquireNodeLock(ReentrantLockService.java:35)

at org.neo4j.kernel.impl.transaction.command.NeoStoreTransactionApplier.visitNodeCommand(NeoStoreTransactionApplier.java:69)

at org.neo4j.kernel.impl.transaction.command.Command$NodeCommand.handle(Command.java:215)

at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:61)

at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:35)

at org.neo4j.kernel.impl.transaction.log.PhysicalTransactionRepresentation.accept(PhysicalTransactionRepresentation.java:69)

at org.neo4j.kernel.impl.api.TransactionToApply.accept(TransactionToApply.java:115)

at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.apply(RecordStorageEngine.java:350)

at org.neo4j.kernel.recovery.DefaultRecoverySPI.lambda$startRecovery$0(DefaultRecoverySPI.java:94)

at org.neo4j.kernel.recovery.DefaultRecoverySPI$$Lambda$135/1326162578.apply(Unknown Source)

at org.neo4j.kernel.impl.api.TransactionQueue.empty(TransactionQueue.java:67)

at org.neo4j.kernel.recovery.DefaultRecoverySPI.allTransactionsRecovered(DefaultRecoverySPI.java:112)

at org.neo4j.kernel.recovery.Recovery.init(Recovery.java:109)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:405)

at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:62)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:98)

at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:525)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)

at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:100)

at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433)

at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)

at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:195)

at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:130)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:101)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.lambda$createDatabaseCreator$0(GraphDatabaseFactory.java:89)

at org.neo4j.graphdb.factory.GraphDatabaseFactory$$Lambda$1/1586600255.newDatabase(Unknown Source)

at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:183)

at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:66)

at seu.lxm.neo4j.cube.LevelSG.

neo4j.conf里的这两个值我是一点点加的,之前单纯开启服务一直报Java栈溢出或者GC,一直到设置为1G和6000m才正常开启服务,现在eclipse实例化这个数据库也是这样报异常,我重新设置了Xms和Xmx,仍然没用。希望知道原因的人帮忙告诉一下解决办法,或者解决思路之类的,不胜感激。

相关文章