Type:
Task
Priority:
Critical
Resolution:
Fixed
Component/s:
None
Per-thread memory usage statistics
Base code and idea from comes from
http://mysql.taobao.org/index.php/Patch_source_code#per-thread_memory_usage_statistics .
User visiable changes:
information_schema.processlist has a new columns: MEMORY_USAGE
SHOW STATUS has a new variable: Memory_used.
The idea is that we mark all memory that are thread specific with MY_THREAD_SPECIFIC.
Memory counting is done per thread in the my_malloc_size_cb_func callback function from my_malloc().
The following changes in interfaces was needed to get this to work:
init_alloc_root() amd init_sql_alloc() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
One now have to use alloc_root_set_min_malloc() to set min memory to be allocated by alloc_root()
my_init_dynamic_array() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
my_net_init() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
Added flag for hash_init() so that one can mark hash table to be thread specific.
Added flags to init_tree() so that one can mark tree to be thread specific.
Added flag to Warning_info::Warning_info() if the structure should be fully initialized.
String elements can now be marked as thread specific.
Other things:
Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
{"report":{"fcp":892.3000000119209,"ttfb":165.60000002384186,"pageVisibility":"visible","entityId":22486,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":16,"apdex":1,"journeyId":"8da2d652-0083-45f6-b0d6-e63074071704","navigationType":0,"readyForUser":989.8000000119209,"redirectCount":0,"resourceLoadedEnd":991.6000000238419,"resourceLoadedStart":175,"resourceTiming":[{"duration":84.19999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":175,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":175,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":259.19999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":85.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":175.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":175.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":260.5,"responseStart":0,"secureConnectionStart":0},{"duration":147.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":175.4000000357628,"connectEnd":175.4000000357628,"connectStart":175.4000000357628,"domainLookupEnd":175.4000000357628,"domainLookupStart":175.4000000357628,"fetchStart":175.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":175.4000000357628,"responseEnd":323.10000002384186,"responseStart":323.10000002384186,"secureConnectionStart":175.4000000357628},{"duration":260.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":175.4000000357628,"connectEnd":175.4000000357628,"connectStart":175.4000000357628,"domainLookupEnd":175.4000000357628,"domainLookupStart":175.4000000357628,"fetchStart":175.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":175.4000000357628,"responseEnd":435.80000001192093,"responseStart":435.80000001192093,"secureConnectionStart":175.4000000357628},{"duration":264.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":175.5,"connectEnd":175.5,"connectStart":175.5,"domainLookupEnd":175.5,"domainLookupStart":175.5,"fetchStart":175.5,"redirectEnd":0,"redirectStart":0,"requestStart":175.5,"responseEnd":439.80000001192093,"responseStart":439.80000001192093,"secureConnectionStart":175.5},{"duration":265,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":175.60000002384186,"connectEnd":175.60000002384186,"connectStart":175.60000002384186,"domainLookupEnd":175.60000002384186,"domainLookupStart":175.60000002384186,"fetchStart":175.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":175.60000002384186,"responseEnd":440.60000002384186,"responseStart":440.60000002384186,"secureConnectionStart":175.60000002384186},{"duration":289,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":175.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":175.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":464.69999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":266.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":175.69999998807907,"connectEnd":175.69999998807907,"connectStart":175.69999998807907,"domainLookupEnd":175.69999998807907,"domainLookupStart":175.69999998807907,"fetchStart":175.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":175.69999998807907,"responseEnd":441.80000001192093,"responseStart":441.80000001192093,"secureConnectionStart":175.69999998807907},{"duration":266.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":175.80000001192093,"connectEnd":175.80000001192093,"connectStart":175.80000001192093,"domainLookupEnd":175.80000001192093,"domainLookupStart":175.80000001192093,"fetchStart":175.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":175.80000001192093,"responseEnd":442.19999998807907,"responseStart":442.19999998807907,"secureConnectionStart":175.80000001192093},{"duration":289,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":176,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":176,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":465,"responseStart":0,"secureConnectionStart":0},{"duration":266.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":176,"connectEnd":176,"connectStart":176,"domainLookupEnd":176,"domainLookupStart":176,"fetchStart":176,"redirectEnd":0,"redirectStart":0,"requestStart":176,"responseEnd":442.69999998807907,"responseStart":442.69999998807907,"secureConnectionStart":176},{"duration":689.6000000238419,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":176.80000001192093,"connectEnd":176.80000001192093,"connectStart":176.80000001192093,"domainLookupEnd":176.80000001192093,"domainLookupStart":176.80000001192093,"fetchStart":176.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":176.80000001192093,"responseEnd":866.4000000357628,"responseStart":866.4000000357628,"secureConnectionStart":176.80000001192093},{"duration":814.8000000119209,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":176.80000001192093,"connectEnd":176.80000001192093,"connectStart":176.80000001192093,"domainLookupEnd":176.80000001192093,"domainLookupStart":176.80000001192093,"fetchStart":176.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":176.80000001192093,"responseEnd":991.6000000238419,"responseStart":991.6000000238419,"secureConnectionStart":176.80000001192093},{"duration":374.2999999523163,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":616.4000000357628,"connectEnd":616.4000000357628,"connectStart":616.4000000357628,"domainLookupEnd":616.4000000357628,"domainLookupStart":616.4000000357628,"fetchStart":616.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":616.4000000357628,"responseEnd":990.6999999880791,"responseStart":990.6999999880791,"secureConnectionStart":616.4000000357628},{"duration":147.30000001192093,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":852.6999999880791,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":852.6999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1000,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":45,"responseStart":165,"responseEnd":173,"domLoading":173,"domInteractive":1161,"domContentLoadedEventStart":1161,"domContentLoadedEventEnd":1226,"domComplete":2351,"loadEventStart":2351,"loadEventEnd":2353,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1117.1000000238419},{"name":"bigPipe.sidebar-id.end","time":1117.800000011921},{"name":"bigPipe.activity-panel-pipe-id.start","time":1118},{"name":"bigPipe.activity-panel-pipe-id.end","time":1124.800000011921},{"name":"activityTabFullyLoaded","time":1236.199999988079}],"measures":[],"correlationId":"94a4f47eecfc47","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":72,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}