Efficient Memory Management for Modelica Simulations

Michele Scuttari, Nicola Camillucci, Daniele Cattaneo, F. Terraneo, G. Agosta
{"title":"Efficient Memory Management for Modelica Simulations","authors":"Michele Scuttari, Nicola Camillucci, Daniele Cattaneo, F. Terraneo, G. Agosta","doi":"10.4230/OASIcs.PARMA-DITAM.2022.7","DOIUrl":null,"url":null,"abstract":"The ever increasing usage of simulations in order to produce digital twins of physical systems led to the creation of specialized equation-based modeling languages such as Modelica. However, compilers of such languages often generate code that exploits the garbage collection memory management paradigm, which introduces significant runtime overhead. In this paper we explain how to improve the memory management approach of the automatically generated simulation code. This is achieved by addressing two different aspects. One regards the reduction of the heap memory usage, which is obtained by modifying functions whose resulting arrays could instead be allocated on the stack by the caller. The other aspect regards the possibility of avoiding garbage collection altogether by performing all memory lifetime tracking statically. We implement our approach in a prototype Modelica compiler, achieving an improvement of the memory management overhead of over 10 times compared to a garbage collected solution, and an improvement of 56 times compared to the production-grade compiler OpenModelica. 2012 ACM Subject Classification Software and its engineering → Compilers; Computing methodo-logies → and","PeriodicalId":436349,"journal":{"name":"PARMA-DITAM@HiPEAC","volume":"23 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"PARMA-DITAM@HiPEAC","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/OASIcs.PARMA-DITAM.2022.7","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

The ever increasing usage of simulations in order to produce digital twins of physical systems led to the creation of specialized equation-based modeling languages such as Modelica. However, compilers of such languages often generate code that exploits the garbage collection memory management paradigm, which introduces significant runtime overhead. In this paper we explain how to improve the memory management approach of the automatically generated simulation code. This is achieved by addressing two different aspects. One regards the reduction of the heap memory usage, which is obtained by modifying functions whose resulting arrays could instead be allocated on the stack by the caller. The other aspect regards the possibility of avoiding garbage collection altogether by performing all memory lifetime tracking statically. We implement our approach in a prototype Modelica compiler, achieving an improvement of the memory management overhead of over 10 times compared to a garbage collected solution, and an improvement of 56 times compared to the production-grade compiler OpenModelica. 2012 ACM Subject Classification Software and its engineering → Compilers; Computing methodo-logies → and
Modelica模拟的高效内存管理
为了生成物理系统的数字双胞胎,模拟的使用不断增加,导致了专门的基于方程的建模语言(如Modelica)的创建。然而,这类语言的编译器经常生成利用垃圾收集内存管理范例的代码,这会带来巨大的运行时开销。本文阐述了如何改进自动生成仿真代码的内存管理方法。这是通过解决两个不同的方面来实现的。一个是减少堆内存使用,这是通过修改函数来实现的,这些函数的结果数组可以由调用者在堆栈上分配。另一方面考虑到通过静态地执行所有内存生命周期跟踪来完全避免垃圾收集的可能性。我们在原型Modelica编译器中实现了我们的方法,与垃圾收集解决方案相比,内存管理开销提高了10倍以上,与生产级编译器OpenModelica相比,内存管理开销提高了56倍。2012 ACM学科分类软件及其工程→编译器;计算方法→和
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信