{"id":35585,"date":"2019-10-31T22:05:11","date_gmt":"2019-10-31T19:05:11","guid":{"rendered":"https:\/\/prohoster.info\/blog\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc\/"},"modified":"2019-10-31T22:05:11","modified_gmt":"2019-10-31T19:05:11","slug":"misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc","status":"publish","type":"post","link":"https:\/\/prohoster.info\/pt\/blog\/news\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc","title":{"rendered":"A Microsoft abriu o c\u00f3digo do sistema de aloca\u00e7\u00e3o de mem\u00f3ria mimalloc","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>A Microsoft lan\u00e7ou sob a licen\u00e7a MIT uma biblioteca <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/microsoft\/mimalloc\">mimalloc<\/a><\/noindex> com implementa\u00e7\u00f5es de um sistema de aloca\u00e7\u00e3o de mem\u00f3ria, originalmente criado para componentes runtime de linguagens <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/koka-lang\/koka\">Koka<\/a><\/noindex> e <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/leanprover\/lean\">Lean<\/a><\/noindex>. Mimalloc \u00e9 adaptado para uso em aplicativos padr\u00e3o sem altera\u00e7\u00f5es em seu c\u00f3digo e pode atuar como uma substitui\u00e7\u00e3o transparente para a fun\u00e7\u00e3o malloc. \u00c9 compat\u00edvel com Windows, macOS, Linux, BSD e outros sistemas Unix-like.<\/p>\n<p>Uma caracter\u00edstica chave do mimalloc \u00e9 a compacta\u00e7\u00e3o da implementa\u00e7\u00e3o (menos de 3500 linhas de c\u00f3digo) e um desempenho muito alto. Nos <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/microsoft\/mimalloc#performance\">testes realizados<\/a><\/noindex> o mimalloc superou todas as bibliotecas de aloca\u00e7\u00e3o de mem\u00f3ria concorrentes em desempenho, incluindo <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/jemalloc\/jemalloc\">jemalloc<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/gperftools\/gperftools\">tcmalloc<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/microsoft\/snmalloc\">snmalloc<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/rampantpixels\/rpmalloc\">rpmalloc<\/a><\/noindex> e <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/emeryberger\/Hoard\">Hoard<\/a><\/noindex>. <\/p>\n<p>Para avaliar o desempenho, foi utilizado um conjunto j\u00e1 existente de  <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/daanx\/mimalloc-bench\">testes padr\u00e3o<\/a><\/noindex> Em alguns testes, o mimalloc supera outros sistemas por v\u00e1rias vezes; por exemplo, no teste de migra\u00e7\u00e3o de objetos entre diferentes threads, o mimalloc foi mais r\u00e1pido que tcmalloc e jemalloc em mais de 2,5 vezes. Al\u00e9m disso, na maioria dos testes tamb\u00e9m foi observada uma menor utiliza\u00e7\u00e3o de mem\u00f3ria, e em algumas situa\u00e7\u00f5es, o consumo de mem\u00f3ria foi reduzido em at\u00e9 25%.<\/p>\n<p><center><img decoding=\"async\" alt=\"A Microsoft abriu o c\u00f3digo do sistema de aloca\u00e7\u00e3o de mem\u00f3ria mimalloc\" src=\"\/wp-content\/uploads\/05811d717a243138d2bc926697657fa1.png\" style=\"display:block;margin: 0 auto;\" \/><\/center><\/p>\n<p>A alta performance \u00e9 alcan\u00e7ada principalmente atrav\u00e9s do uso de segmenta\u00e7\u00e3o da lista de blocos livres (free list sharding). Em vez de uma \u00fanica lista grande, o mimalloc utiliza uma divis\u00e3o em uma s\u00e9rie de listas menores, cada uma associada a uma p\u00e1gina de mem\u00f3ria. Essa abordagem reduz a fragmenta\u00e7\u00e3o e melhora a localiza\u00e7\u00e3o de dados na mem\u00f3ria. Uma p\u00e1gina de mem\u00f3ria \u00e9 entendida como um conjunto agrupado de blocos pr\u00f3ximos em tamanho. Em sistemas de 64 bits, o tamanho da p\u00e1gina geralmente \u00e9 de 64 KB. Caso n\u00e3o haja blocos ocupados na p\u00e1gina, ela \u00e9 totalmente liberada, retornando a mem\u00f3ria ao sistema operacional, o que ajuda a reduzir os custos de mem\u00f3ria e a fragmenta\u00e7\u00e3o em programas que funcionam por longos per\u00edodos.<\/p>\n<p>A biblioteca pode ser conectada na etapa de vincula\u00e7\u00e3o ou carregada para um programa j\u00e1 compilado (&#171;LD_PRELOAD=\\\/usr\\\/bin\\\/libmimalloc.so  myprogram&#187;). A biblioteca tamb\u00e9m fornece <noindex><a rel=\"nofollow\" href=\"https:\/\/microsoft.github.io\/mimalloc\/group__extended.html\">API<\/a><\/noindex> para a integra\u00e7\u00e3o de funcionalidade em tempo de execu\u00e7\u00e3o e controle refinado do comportamento, por exemplo, para conectar manipuladores de libera\u00e7\u00e3o de mem\u00f3ria adiada e aumento mon\u00f3tono de contadores de refer\u00eancias. H\u00e1 a possibilidade de criar e usar v\u00e1rias &#171;pilhas&#187; (heap) na aplica\u00e7\u00e3o para distribui\u00e7\u00e3o em diferentes \u00e1reas de mem\u00f3ria. Tamb\u00e9m \u00e9 poss\u00edvel liberar a pilha completamente, sem percorrer e liberar separadamente os objetos alocados nela.<\/p>\n<p>Est\u00e1 prevista a possibilidade de compilar a biblioteca em modo seguro, onde, nas fronteiras dos blocos, s\u00e3o inseridas p\u00e1ginas de verifica\u00e7\u00e3o especiais de mem\u00f3ria (guard-page), al\u00e9m de randomiza\u00e7\u00e3o na aloca\u00e7\u00e3o de blocos e criptografia das listas de blocos liberados. Essas medidas ajudam a bloquear a maioria das t\u00e9cnicas t\u00edpicas de explora\u00e7\u00e3o de estouro de buffer na pilha. Ao ativar o modo seguro, o desempenho \u00e9 reduzido em cerca de 3%.<\/p>\n<p>Entre as caracter\u00edsticas do mimalloc, destaca-se a resist\u00eancia a problemas de incha\u00e7o, mesmo com alta fragmenta\u00e7\u00e3o. No pior cen\u00e1rio, o consumo de mem\u00f3ria aumenta em 0,2% para metadados e pode chegar a 16,7% para a mem\u00f3ria alocada. Para excluir conflitos no acesso a recursos, o mimalloc utiliza apenas opera\u00e7\u00f5es at\u00f4micas.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"link\"><\/a><\/noindex><\/p>\n<p>Fonte: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=50939\">opennet.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 mimalloc \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u044f runtime-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u044f\u0437\u044b\u043a\u043e\u0432 Koka \u0438 Lean. Mimalloc \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0445 \u043a\u043e\u0434\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 malloc. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0432 Windows, macOS, Linux, BSD \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e mimalloc [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-35585","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 mimalloc \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/pt\/blog\/news\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_PT\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b \u043a\u043e\u0434 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 mimalloc | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 mimalloc \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/pt\/blog\/news\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:05:11+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:05:11+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47A Microsoft abriu o c\u00f3digo do sistema de aloca\u00e7\u00e3o de mem\u00f3ria mimalloc | ProHoster","description":"A Microsoft abriu sob a licen\u00e7a MIT a biblioteca mimalloc, com a implementa\u00e7\u00e3o de um sistema de aloca\u00e7\u00e3o de mem\u00f3ria originalmente criado.","canonical_url":"https:\/\/prohoster.info\/pt\/blog\/news\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pt_PT","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b \u043a\u043e\u0434 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 mimalloc | ProHoster","og:description":"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Mi\u0441rosoft \u043e\u0442\u043a\u0440\u044b\u043b\u0430 \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 mimalloc \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439.","og:url":"https:\/\/prohoster.info\/pt\/blog\/news\/misrosoft-otkryl-kod-sistemy-raspredeleniya-pamyati-mimalloc","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:05:11+00:00","article:modified_time":"2019-10-31T19:05:11+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"35585","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 23:52:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 01:59:36","updated":"2026-01-21 23:52:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/35585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/comments?post=35585"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/35585\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media?parent=35585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/categories?post=35585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/tags?post=35585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}