You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Harif-Rahman (via GitHub)" <gi...@apache.org> on 2023/04/11 07:36:35 UTC

[GitHub] [shardingsphere] Harif-Rahman opened a new issue, #25101: Heap memory is increased due to sql comment via statement inspector

Harif-Rahman opened a new issue, #25101:
URL: https://github.com/apache/shardingsphere/issues/25101

   ## Bug Report
   
   Spring boot version : 2.1.5.RELEASE
   JDK : amazoncorretto:8u332
   ShardingSphere version : 4.0.1
   
   We have introduced a change to pass the request id for every outgoing sql  for tracing purpose.
   After this change we have observed increase in jvm heap memory
   
   
   <img width="1539" alt="image" src="https://user-images.githubusercontent.com/48013254/231089066-96d58c49-c310-4a52-946a-1613c0746b6e.png">
   <img width="1530" alt="image" src="https://user-images.githubusercontent.com/48013254/231089110-a9174725-6859-43bb-8209-aca8115c8c2c.png">
   
   
   Statement inspector class : 
   public class SqlStatementInspector implements StatementInspector {
     private static final int REQUEST_PATH_MAX_LENGTH = 50;
     @Override
     public String inspect(String sql) {
       // add request id in sql as comment eg : **select * from table t1 /* R:1 23 P: /api/v1 */ **
   
      return sql + /* R: getrequestid() P: getrequestPath() */
     }
   }
   
   JPA property : 
   entityManagerFactory.getJpaPropertyMap().put(AvailableSettings.STATEMENT_INSPECTOR, SqlStatementInspector.class);
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ### Expected behavior
   
   ### Actual behavior
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #25101: Heap memory increase due to sql comment

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #25101:
URL: https://github.com/apache/shardingsphere/issues/25101#issuecomment-1504591167

   The version 4.x is out of service, please try 5.x


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Harif-Rahman commented on issue #25101: Heap memory increase due to sql comment

Posted by "Harif-Rahman (via GitHub)" <gi...@apache.org>.
Harif-Rahman commented on issue #25101:
URL: https://github.com/apache/shardingsphere/issues/25101#issuecomment-1504664604

   Tried the latest version 5.2.0 Same issue again.
   <img width="1629" alt="image" src="https://user-images.githubusercontent.com/48013254/231358990-d130b95b-4d0f-4850-8440-bb809d41cd73.png">
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu closed issue #25101: Heap memory increase due to sql comment

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #25101: Heap memory increase due to sql comment
URL: https://github.com/apache/shardingsphere/issues/25101


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org