简体   繁体   English

org.hibernate.hql.internal.ast.tree.Node 在 jmap 堆转储中是什么意思

[英]What does org.hibernate.hql.internal.ast.tree.Node means in jmap heap dump

I have a spring boot application that used spring data.我有一个使用 spring 数据的 spring boot 应用程序。 I have native queries and query methods.我有本机查询和查询方法。 Apparently i'm facing a memory issue from my application.显然,我的应用程序遇到了内存问题。 I tried doing jmap -histo to determine the class that uses a lot of resource.我尝试执行 jmap -histo 来确定使用大量资源的类。

On my first jmap dump this is the result (first day) -fresh start在我的第一次 jmap 转储中,这是结果(第一天)-重新开始

第一的

Then on the second day this is the result然后在第二天这是结果

第二

Notice the org.hibernate.hql.internal.ast.tree.Node starts to appear.注意 org.hibernate.hql.internal.ast.tree.Node 开始出现。

Then on the third day然后第三天第三

The org.hibernate.hql.internal.ast.tree.Node is increasing in memory size. org.hibernate.hql.internal.ast.tree.Node 的内存大小正在增加。

Hope you can help me, or any suggestion?希望你能帮助我,或者有什么建议? I haven't posted the code since I haven't isolated the one causing this.我没有发布代码,因为我没有隔离导致这个的代码。 Btw, there are no operations during the night so i'm expecting garbage collection should run.顺便说一句,夜间没有操作,所以我期待垃圾收集应该运行。

I can't answer what was causing this.我无法回答是什么导致了这种情况。 However, updating the version of Spring Boot (which in turn updated the Hibernate version) to 2.2.1.RELEASE appeared to resolve these issues for me.但是,将 Spring Boot 的版本(进而更新 Hibernate 版本)更新到 2.2.1.RELEASE 似乎为我解决了这些问题。

I also encountered the same problem.我也遇到了同样的问题。 The following configuration may help.以下配置可能会有所帮助。

spring:
  jpa:
    properties:
      hibernate:
        query:
          plan_cache_max_size: 64
          plan_parameter_metadata_max_size: 32

Apparently, hibernate is caching all of its queries this is so that hibernate will not recompile prepared statement however if you have a dynamic query it will result to memory overflow.显然,hibernate 正在缓存它的所有查询,这样 hibernate 就不会重新编译准备好的语句,但是如果你有一个动态查询,它会导致内存溢出。

Ex:前任:

Prepared Statement准备好的报表

Select * from employee where id = :id

-> this is okay since hibernate will just cache the prepared statement but if you do something like this -> 这没问题,因为 hibernate 只会缓存准备好的语句,但是如果你做这样的事情

select * from employee where id = 1
select * from employee where id = 2
select * from employee where id = 3

-> Hibernate will cache that 3 statement hence the memory overflow. -> Hibernate 将缓存那 3 条语句,因此内存溢出。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 引起:org.hibernate.QueryException:节点没有数据类型:org.hibernate.hql.internal.ast.tree.MethodNode - Caused by: org.hibernate.QueryException: No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode 节点没有数据类型:org.hibernate.hql.internal.ast.tree.IdentNode HQL - No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode HQL 节点没有数据类型:org.hibernate.hql.internal.ast.tree.MethodNode - No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode HTTP状态500-节点无数据类型:org.hibernate.hql.internal.ast.tree.IdentNode - HTTP Status 500 - No data type for node: org.hibernate.hql.internal.ast.tree.IdentNode ClassCastException: org.hibernate.hql.internal.ast.tree.SqlNode 无法转换为 org.hibernate.hql.internal.ast.tree.PathNode - ClassCastException: org.hibernate.hql.internal.ast.tree.SqlNode cannot be cast to org.hibernate.hql.internal.ast.tree.PathNode java.lang.IllegalArgumentException:org.hibernate.QueryException:节点没有数据类型:org.hibernate.hql.internal.ast.tree.MethodNode - java.lang.IllegalArgumentException: org.hibernate.QueryException: No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode JPQL 运算符返回 java.lang.IllegalStateException - 节点无数据类型:org.hibernate.hql.internal.ast.tree.MethodNode - JPQL Operator returns a java.lang.IllegalStateException - No data type for node: org.hibernate.hql.internal.ast.tree.MethodNode org.hibernate.hql.internal.ast.QuerySyntaxException - org.hibernate.hql.internal.ast.QuerySyntaxException java.lang.ClassCastException:org.hibernate.hql.internal.ast.tree.SqlNode无法转换为org.hibernate.hql.internal.ast.tree.FromReferenceNode - java.lang.ClassCastException: org.hibernate.hql.internal.ast.tree.SqlNode cannot be cast to org.hibernate.hql.internal.ast.tree.FromReferenceNode hibernate hsql出现错误节点没有数据类型:org.hibernate.hql.ast.tree.IdentNode - hibernate hsql getting error No data type for node: org.hibernate.hql.ast.tree.IdentNode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM