【发布时间】:2019-05-08 09:00:27
【问题描述】:
将 Spring Boot 应用程序部署到 Pivotal Cloud Foundry 失败并出现以下错误。实例的限制设置为 2GB,然后设置为 4GB。本地应用程序以 2GB 堆大小正常启动。 应用程序在缓存管理器初始化期间失败。 知道可能是什么根本原因吗?不确定 terracotta 在云代工中扮演什么角色,还有什么需要寻找的?
2019-05-07T19:24:53.39+0530 [APP/PROC/WEB/0] OUT at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2019-05-07T19:24:53.39+0530 [APP/PROC/WEB/0] OUT Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.cache.CacheManager]: Factory method 'cacheManager' threw exception; nested exception is org.ehcache.StateTransitionException: Cache '<name hidden>' creation in EhcacheManager failed.
....
Caused by: java.lang.IllegalArgumentException: An attempt was made to allocate more off-heap memory than the JVM can allow. The limit on off-heap memory size is given by the -XX:MaxDirectMemorySize command (or equivalent).
2019-05-07T19:15:13.15+0530 [APP/PROC/WEB/0] OUT at org.terracotta.offheapstore.paging.UpfrontAllocatingPageSource.bufferAllocation(UpfrontAllocatingPageSource.java:564)
2019-05-07T19:15:13.15+0530 [APP/PROC/WEB/0] OUT at org.terracotta.offheapstore.paging.UpfrontAllocatingPageSource.lambda$allocateBackingBuffers$1(UpfrontAllocatingPageSource.java:513)
2019-05-07T19:15:13.15+0530 [APP/PROC/WEB/0] OUT at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2019-05-07T19:15:13.15+0530 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2019-05-07T19:15:13.15+0530 [APP/PROC/WEB/0] OUT at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2019
编辑: 已修复,通过移除堆外 ehcache 配置:maxBytesLocalOffHeap
【问题讨论】:
标签: jvm heap-memory cloud-foundry terracotta