URL: <https://savannah.gnu.org/bugs/?66127>
Summary: [Bash x86] Increased memory bandwidth due to background commands Group: The GNU Bourne-Again SHell Submitter: korantli Submitted: Mon 26 Aug 2024 03:10:18 AM UTC Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Mon 26 Aug 2024 03:10:18 AM UTC By: korantli <korantli> Hey guys,we found a strange issue about bash In bash version: v4.2.46\v4.4.20\v5.2, we found following issue. When we run the script blow: #! /bin/bash while :; do echo "test" & # wait $! sleep 1 done We found that background commands cause memory bandwidth to increase with runtime by intel's tool pcm-memory(https://github.com/intel/pcm). When first start running the script, the bandwidth is about 50-100MB/s. But after 3 days, it increases to 1000-1500MB/s. Besides, we found the script's RSS(watched by pidstat) will continue to increase. We found when issue occurred, the script's _int_free\_int_malloc\malloc_consolidate is first 3 top hot perf events collected by "perf record -e mem-loads -e mem-stores -g -p xxx -- sleep 10". However when first start running script, they are not the hottest. We believe the these mem events is the key reason why memory bandwidth increasing. However, we can't find out why bash do it. Also, we found "(echo "test" &)" will fix this issue. It will be so grateful if anyone could help~ _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?66127> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
Description: PGP signature