mmcLine opened a new issue, #22290:
URL: https://github.com/apache/shardingsphere/issues/22290

   ## Question
   
   when i use this sql:
   ```
   <insert id="batchInsertOrder" parameterType="com.mmc.sharding.bean.Order" >
           insert into t_order (id,code,amt,user_id,create_time)
           values
           <foreach collection="list" item="item" separator=",">
               
(#{item.id},#{item.code},#{item.amt},#{item.userId},#{item.createTime})
           </foreach>
       </insert>
   ```
   
   Because the number of parameters I pass in is different, the generated sql 
is different。
   
   These sql will be cached,Cause fullgc.
   
   ```
   public final class SQLStatementParserEngine {
       private final SQLStatementParserExecutor sqlStatementParserExecutor;
       private final LoadingCache<String, SQLStatement> sqlStatementCache;
   
       public SQLStatementParserEngine(String databaseType, SQLParserRule 
sqlParserRule) {
           this.sqlStatementParserExecutor = new 
SQLStatementParserExecutor(databaseType, sqlParserRule);
           this.sqlStatementCache = 
SQLStatementCacheBuilder.build(sqlParserRule, databaseType);
       }
   
       public SQLStatement parse(String sql, boolean useCache) {
           return useCache ? 
(SQLStatement)this.sqlStatementCache.getUnchecked(sql) : 
this.sqlStatementParserExecutor.parse(sql);
       }
   }
   ```
   The cache occupies 800m:
   
![image](https://user-images.githubusercontent.com/37876129/202889359-5a295abe-cbc3-4863-98d3-5d1bf144c851.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: 
[email protected]

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

Reply via email to