首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GORM/Hibernate + GC开销超过上限

GORM/Hibernate + GC开销超过上限
EN

Stack Overflow用户
提问于 2016-02-04 17:01:36
回答 1查看 341关注 0票数 0

下面的remove()方法导致“超过GC开销限制”。当将ABC中的协会从A、B或C中删除时,您能告诉我出了什么问题吗?注: ABC是A,B,C的映射表。

堆栈跟踪如下:Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.jar.Attributes.read(Attributes.java:394) at java.util.jar.Manifest.read(Manifest.java:199) at java.util.jar.Manifest.<init>(Manifest.java:69) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:185) at java.util.jar.JarFile.getManifest(JarFile.java:166) at java.net.URLClassLoader.defineClass(URLClassLoader.java:416) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:171) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:143) at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

代码语言:javascript
复制
@Resource() 
@EqualsAndHashCode 
class ABC {
    static belongsTo = 
        [
            a: A, 
            b: B, 
            c: C
        ]

    def remove(){
        this.a?.removeFromBC(this)
        this.b?.removeFromAC(this)
        this.c?.removeFromAB(this)
        this.delete()
    }

@Resource()
class C {
    Collection<ABC> aB
    static hasMany = [aB: ABC]
    static constraints = {
        aB cascade: "all-delete-orphan", nullable: true
    }
}

@Resource()
class B {
    Collection<ABC> aC
    static hasMany = [aC: ABC]
    static constraints = {
        aC cascade: "all-delete-orphan", nullable: true
    }
}

@Resource()
class A {
    Collection<ABC> bC
    static hasMany = [bC: ABC]
    static constraints = {
        bC cascade: "all-delete-orphan", nullable: true
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-04 17:31:13

不,该方法没有触发OOME,运行时分配的堆空间太少。增加服务器的内存。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35207084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档