Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-8483: SpilledRecordBatch memory leak when the program threw an … #2888

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

shfshihuafeng
Copy link
Contributor

@shfshihuafeng shfshihuafeng commented Mar 8, 2024

…exception during the process of building a hash table (#2887)

DRILL-8483: SpilledRecordBatch memory leak when the program threw an exception during the process of building a hash table

Description

During the process of reading data from disk to building hash tables in memory, if an exception is thrown, it will result in a memory SpilledRecordBatch leak
there is no sql runing
image

memory
image

leak info


Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/98304/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/69632/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/30642176/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/36864/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/8192/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/98304/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/36864/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:1) 5000000/1000000/31035392/40041943040 (res/actual/peak/limit)
    Allocator(op:5:1:1:HashJoinPOP) 1000000/98304/22822912/41943040 (res/actual/peak/limit)
Allocator(frag:5:0) 5000000/1000000/31067136/40041943040 (res/actual/peak/limit)
    Allocator(op:5:0:1:HashJoinPOP) 1000000/98304/22822912/41943040 (res/actual/peak/limit)

Documentation

(Please describe user-visible changes similar to what should appear in the Drill documentation.)

Testing

prepare data for tpch 1s

  1. 30 concurrent for tpch sql8
  2. set direct memory 5g
  3. when it had OutOfMemoryException , stopped all sql.
  4. finding memory leak

test script

random_sql(){
#for i in `seq 1 3`
while true
do

  num=$((RANDOM%22+1))
  if [ -f $fileName ]; then
  echo "$fileName" " is exit"
  exit 0
  else
          $drill_home/sqlline -u \"jdbc:drillr:zk=ip:2181/drillbits_shf\" -f tpch_sql8.sql >> sql8.log 2>&1
  fi
done
}

main(){
#sleep 2h

#TPCH power test
for i in `seq 1 30`
do
        random_sql &
done
}

@cgivre cgivre requested a review from jnturton March 8, 2024 17:13
@cgivre cgivre added bug backport-to-stable This bug fix is applicable to the latest stable release and should be considered for inclusion there labels Mar 8, 2024
…exception during the process of building a hash table (apache#2887)
Copy link
Contributor

@cgivre cgivre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@cgivre cgivre merged commit 86d3c66 into apache:master Mar 29, 2024
8 checks passed
jnturton pushed a commit to jnturton/drill that referenced this pull request Apr 12, 2024
jnturton pushed a commit that referenced this pull request Apr 12, 2024
…exception during the process of building a hash table (#2887) (#2888)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-stable This bug fix is applicable to the latest stable release and should be considered for inclusion there bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants