leshjmail opened a new issue, #3101:
URL: https://github.com/apache/hugegraph/issues/3101

   ### Bug Type (问题类型)
   
   performance (性能下降)
   
   ### Before submit
   
   - [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 
[FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have 
confirmed and searched that there are no similar problems in the historical 
issue and documents)
   
   ### Environment (环境信息)
   
   - Server Version: 1.5.0 (Apache Release Version)
   - Backend: Mysql
   - OS: CentOS 7.x 
   
   
   ### Expected & Actual behavior (期望与实际表现)
   
   - 问题描述:
     1、内存dump中mysql驱动实例呈线性增长趋势
     2、gc回收后占用空间没有下降,直至内存溢出
   - 问题分析
      在ResultSetWrapper中创建和close方法中分别加入日志,发现存在一定比例的ResultSetWrapper没有正常调用关闭方法。
   - 问题解决
      在ResultSetWrapper中加入finalize方法,在回收前判断resultSet和statement有没有正常关闭,未关闭则处理
      加入此处理后问题解决。
     @Override
       protected void finalize() {
           try {
               if (this.resultSet != null && !this.resultSet.isClosed()) {
                   LOG.warn("resultSet was not closed properly, forcing close 
via finalize");
                   this.resultSet.close();
               }
           } catch (SQLException e) {
               throw new BackendException("Failed to close ResultSet", e);
           } finally {
               try {
                   if (this.statement != null && !this.statement.isClosed()) {
                       LOG.warn("statement was not closed properly, forcing 
close via finalize");
                       this.statement.close();
                   }
               } catch (SQLException e) {
                   throw new BackendException("Failed to close Statement", e);
               }
           }
       }
   
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   
   ```
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to