Allocating largest buffer without using swap

前端 未结 4 2024
挽巷
挽巷 2021-02-05 19:57

In C/C++ under Linux, I need to allocate a large (several gigabyte) block of memory, in order to store real-time data from a sensor connected to the ethernet port and streaming

4条回答
  •  萌比男神i
    2021-02-05 20:55

    If the computer system is dedicated to receiving data from your sensor, you can simply disable swap. Then allocate as big buffer as you can, leaving enough memory in the system only for essential tools.

提交回复
热议问题