内存管理是操作系统还是编程语言的任务? [英] Memory management is the task of operating system or programming language?

查看:144
本文介绍了内存管理是操作系统还是编程语言的任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

内存管理是操作系统或编程语言的任务吗?

Memory management is the task of operating system or programming language?

推荐答案

内存管理(MM)可能出现在计算机系统的每个部分中。
>


在最低级别,计算机平台具有用于分段,分页和内存保护的特殊硬件。



编译器可以将二进制图像分成代码/数据/零初始化数据部分。



OS / VM可以提供用于管理堆/系统堆栈,内存同步的API。



例如为进程分配堆栈,执行进程间通信。





在用户级别,某些库也可以通过预分配来执行MM用于高效数据访问的内存池。



例如某些网络堆栈可能会为DMA R / W访问预分配缓冲区



例如图形相关代码可以预先分配用于保持转换模型的顶点的缓冲区。
Memory management(MM) may appear in every part of the computer system.

At the lowest level, Computer platforms have special hardware for segmentation, paging and memory protection.

Compiler may divide the binary image into code/data/zero initialized data section.

The OS/VM may provide API for managing the heap/system stack, memory synchronization.

e.g. allocating stack for process, performing inter-process communication.


At user level, some library may also do the MM by pre-allocating a memory pool for efficient data access.

e.g. Some network stack may pre-allocate buffer for DMA R/W access

e.g. Graphic related code may pre-allocate buffer for holding vertex for model for transformation.


这篇关于内存管理是操作系统还是编程语言的任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆