当前位置:网站首页>PHP函数file_get_contents与操作系统的内存映射
PHP函数file_get_contents与操作系统的内存映射
2022-06-28 23:44:00 【aben_sky】
内存映射,英文是 memory mapping ,即 将一个文件或者其它对象映射到进程的地址空间,实现文件磁盘地址和进程虚拟地址空间中一段虚拟地址的一一对映关系 。实现这样的映射关系后,进程就可以采用指针的方式读写操作这一段内存,而系统会自动回写脏页面到对应的文件磁盘上,即完成了对文件的操作而不必再调用 read、write 等系统调用函数。相反,内核空间对这段区域的修改也直接反映用户空间,从而可以实现不同进程间的文件共享。
因为有了这个功能,我们在读写本地文件时的速度都大大的提升。
php manual中的一段文字如下:
file_get_contents() 函数是用来将文件的内容读入到一个字符串中的首选方法。如果操作系统支持还会使用内存映射技术来增强性能。
windows10下查看内存映射的软件: https://docs.microsoft.com/zh-cn/sysinternals/downloads/rammap
下载后执行 RAMMap64.exe就可以看到本地系统的内存映射数据。File Details标签下会显示所有映射的文件。如果需要清空,可以使用菜单"Empty"下的命令。
边栏推荐
- stm32F407-------串行(串口)通信
- [stm32 HAL库] 串口通信
- [matlab] function definition and use
- Would like to ask, how to open a stock account? Is it safe to open an account online?
- At the end of June, how many people in Kangkang are ready to change jobs
- MySQL connection query is easy to understand
- 百度知道爬虫,根据问题id,线索id,评论id获取评论下面的对话
- Oil monkey script learning
- What pitfalls should be avoided in the job interview for the operation post in 2022?
- stm32F407-------RTC实时时钟
猜你喜欢

stm32F407-------时钟系统(SystemInit时钟初始化、Systick滴答定时器)

关联线探究,如何连接流程图的两个节点

Quartz explanation and use

机器学习4-降维技术
![[mathematical modeling] fmincon() function of MATLAB nonlinear programming](/img/fc/46949679859b1369fcc83d0d8b637c.png)
[mathematical modeling] fmincon() function of MATLAB nonlinear programming
![[stm32 HAL库] 串口通信](/img/2c/23a2ecf75141b8f38ab99ac6b2eaef.png)
[stm32 HAL库] 串口通信

Online yaml to JSON tool

What are the virtual machine software? What are their respective roles?

Learning fuzzy from SQL injection to bypass the latest safe dog WAF
![[word Tutorial Series Part 1] how to remove arrows in word tables](/img/c7/dc57002b0e9d433c4dfac15d53713d.png)
[word Tutorial Series Part 1] how to remove arrows in word tables
随机推荐
从SQL注入绕过最新安全狗WAF中学习fuzz
stm32F407-------NVIC中断优先级管理
Analysis of CSRF Cross Site Request Forgery vulnerability
What are the virtual machine software? What are their respective roles?
股票开户在网上开通安全吗?
Online yaml to JSON tool
Is it safe to open a stock account on the Internet?
ROS2中的行为树 BehaviorTree
The second session of question swiping and clock out activity -- solving the switching problem with recursion as the background (2)
入行数字IC验证后会做些什么?
Learn binary tree like this
Stm32f407 ------ clock system (systeminit clock initialization, systick tick timer)
stm32F407-------GPIO输入实验
Is it difficult to register stocks and open accounts online? Is it safe to open an account online?
ES6模块
Yyds dry inventory solution sword finger offer: maximum sum of continuous subarrays (II)
Ahai's advice
机器学习6-决策树
Yes, use local_ setup. Bash or setup bash
[SSM] an error is reported that the user name of the access denied for user 'WYF' @ 'localhost' (using password: yes) data becomes the user name of the computer