[MCOL-4042] MODA function memory leak Created: 2020-06-05  Updated: 2020-06-22  Due: 2020-06-05  Resolved: 2020-06-22

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 1.4.3, 1.5.2
Fix Version/s: 1.5.2

Type: Bug Priority: Major
Reporter: David Hall (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

The UDAF MODA creates a hashmap that it doesn't clean up.



 Comments   
Comment by David Hall (Inactive) [ 2020-06-05 ]

This turned out to be a bit more complex than a simple delete.
QA. This is a memory leak problem. I'm not sure how you generally test these things. The problem appears when using the MODA UDAF, which calculates the average mode of a numeric column with certain tie breakers.

Comment by Patrick LeBlanc (Inactive) [ 2020-06-10 ]

When you can, don't forget to create PRs for the other branches affected by this. 1.4, and possibly 1.2.

Comment by David Hall (Inactive) [ 2020-06-16 ]

Tested in valgrind – no leaks.
Created PR for 1.4

Comment by Daniel Lee (Inactive) [ 2020-06-22 ]

Build verified: 1.5.2-1 (community server b33685)

Run a moda() test on a 1gb dbt3 database:

SELECT MODA(l_extendedprice) FROM lineitem;

Release 1.5.2-1 used less than 1/2 of memory used in 1.4.3-6

1.5.2-1

[centos7:root~]# cat top.log |grep "KiB Mem :" > memStats.txt
[centos7:root~]# head -n 1 memStats.txt
KiB Mem : 41036684 total, 32600892 free, 6431040 used, 2004752 buff/cache
[centos7:root~]# tail -n 1 memStats.txt
KiB Mem : 41036684 total, 32671276 free, 6392944 used, 1972464 buff/cache
[centos7:root~]# sort -k8 -n memStats.txt |tail -n 1
KiB Mem : 41036684 total, 32285488 free, 6776956 used, 1974240 buff/cache

used: 345916

1.4.3-6

[centos7:root~]# head -n 1 memStats.txt
KiB Mem : 5944344 total, 1534740 free, 699560 used, 3710044 buff/cache
[centos7:root~]# tail -n 1 memStats.txt
KiB Mem : 5944344 total, 777252 free, 1487932 used, 3679160 buff/cache
[centos7:root~]# sort -k8 -n memStats.txt |tail -n 1
KiB Mem : 5944344 total, 775656 free, 1489576 used, 3679112 buff/cache

used: 790016

Generated at Thu Feb 08 02:47:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.