{"id":186953,"date":"2011-10-28T00:00:00","date_gmt":"2011-11-01T14:13:03","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/msr-research-item\/why-nothing-matters-the-impact-of-zeroing-2\/"},"modified":"2016-08-22T11:32:53","modified_gmt":"2016-08-22T18:32:53","slug":"why-nothing-matters-the-impact-of-zeroing-2","status":"publish","type":"msr-video","link":"https:\/\/www.microsoft.com\/en-us\/research\/video\/why-nothing-matters-the-impact-of-zeroing-2\/","title":{"rendered":"Why Nothing Matters: The Impact of Zeroing"},"content":{"rendered":"
\n

Managed languages use memory safety to defend against inadvertent and malicious misuse of memory. Unmanaged native languages are increasingly integrating memory safety for the same reasons. A critical element of memory safety is initializing new memory before the program obtains it. Our experiments show that zero initialization is surprisingly expensive in a highly optimized managed runtime \u2014 on average the direct cost of zeroing is 4% to 6% and up to 50% of total application time on a variety of modern processors. Zeroing incurs indirect costs as well, which include memory bandwidth consumption and cache displacement. Existing virtual machines (VMs) either: a) minimize direct costs by zeroing in large blocks, or b) minimize indirect costs by integrating zeroing into the allocation sequence to reduce cache displacement.<\/p>\n

This paper first describes and evaluates zero initialization costs and the two existing design points. Our micro architectural analysis of prior designs inspires two better designs that exploit concurrency and non-temporal cache-bypassing instructions to reduce the direct and indirect costs simultaneously. We show that the best strategy is to adaptively choose between the two new designs based on CPU utilization. This approach improves over widely used hot-path zeroing by 3% on average and up to 15% on the newest Intel i7-2600 processor, without slowing down any of the benchmarks. These results indicate that zero initialization is a surprisingly important source of overhead in existing VMs and that our new software strategies are effective at reducing this overhead. These findings also invite other optimizations, including software elision of zeroing and micro architectural support.<\/p>\n<\/div>\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

Managed languages use memory safety to defend against inadvertent and malicious misuse of memory. Unmanaged native languages are increasingly integrating memory safety for the same reasons. A critical element of memory safety is initializing new memory before the program obtains it. Our experiments show that zero initialization is surprisingly expensive in a highly optimized managed […]<\/p>\n","protected":false},"featured_media":196457,"template":"","meta":{"msr-url-field":"","msr-podcast-episode":"","msrModifiedDate":"","msrModifiedDateEnabled":false,"ep_exclude_from_search":false,"_classifai_error":"","footnotes":""},"research-area":[],"msr-video-type":[],"msr-locale":[268875],"msr-post-option":[],"msr-impact-theme":[],"msr-pillar":[],"class_list":["post-186953","msr-video","type-msr-video","status-publish","has-post-thumbnail","hentry","msr-locale-en_us"],"msr_download_urls":"","msr_external_url":"https:\/\/youtu.be\/zPjE8unY5gw","msr_secondary_video_url":"","msr_video_file":"","_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video\/186953"}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/types\/msr-video"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video\/186953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media\/196457"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/media?parent=186953"}],"wp:term":[{"taxonomy":"msr-research-area","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/research-area?post=186953"},{"taxonomy":"msr-video-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-video-type?post=186953"},{"taxonomy":"msr-locale","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-locale?post=186953"},{"taxonomy":"msr-post-option","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-post-option?post=186953"},{"taxonomy":"msr-impact-theme","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-impact-theme?post=186953"},{"taxonomy":"msr-pillar","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/research\/wp-json\/wp\/v2\/msr-pillar?post=186953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}