[ 
https://issues.apache.org/jira/browse/IGNITE-22437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854928#comment-17854928
 ] 

YuJue Li commented on IGNITE-22437:
-----------------------------------

This issue occurs in the scenario where replicated tables and partition tables 
are joined. If the execution of SQL is split into multiple steps, there is a 
probability that resources are closed but not removed. The problematic code 
points are attached.

 

 

> Memory leak in MapNodeResults
> -----------------------------
>
>                 Key: IGNITE-22437
>                 URL: https://issues.apache.org/jira/browse/IGNITE-22437
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.16
>            Reporter: YuJue Li
>            Assignee: YuJue Li
>            Priority: Critical
>             Fix For: 2.17
>
>         Attachments: LBhb6p1xyLaiid7r.png, memoryleak.jpg
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> start 2 node by ignite.sh
> execute the following SQL:
> create table dwd_t_order_loan_apply (
> order_id varchar,
> identity_no varchar,
> loan_date varchar,
> primary key (order_id,identity_no)
> ) WITH 
> "template=partitioned,affinity_key=identity_no,CACHE_NAME=dwd_t_order_loan_apply";
> create table dim_current_x_day (
> id int,
> biz_type int,
> PRIMARY KEY (id)
> ) WITH "TEMPLATE=replicated,CACHE_NAME=dim_current_x_day";
> INSERT INTO DWD_T_ORDER_LOAN_APPLY (ORDER_ID,IDENTITY_NO,LOAN_DATE) VALUES 
> ('100000081','510322','2023-11-09 15:05:04');
> INSERT INTO DIM_CURRENT_X_DAY (ID,BIZ_TYPE) VALUES (1,1);
> INSERT INTO DIM_CURRENT_X_DAY (ID,BIZ_TYPE) VALUES (3,1);
> INSERT INTO DIM_CURRENT_X_DAY (ID,BIZ_TYPE) VALUES (7,1);
> INSERT INTO DIM_CURRENT_X_DAY (ID,BIZ_TYPE) VALUES (15,1);
> INSERT INTO DIM_CURRENT_X_DAY (ID,BIZ_TYPE) VALUES (30,1);
>  
> execute following query some times:
>  
> SELECT b.id,
> max(last_trade) "last_trade"
> from
> (select max(loan_date) last_trade
> from dwd_t_order_loan_apply where identity_no='510322'
> ) a JOIN dim_current_x_day b
> GROUP BY b.id;
>  
> execute following command :
> jmap -dump:format=b,file=/data/ignite.bin <ignite pid>
>  
> open ignite.bin by eclipse MAT:
> At this point, you will see that there is data in the res instance object in 
> MapNodeResults, which can lead to a serious memory leak issue, which is a 
> serious vulnerability.
> The normal SQL execution process involves releasing the resources held in the 
> res instance object in MapNodeResults after a SQL query is executed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to