{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/memory/feed/json -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/memory", "feed_url": "https://matoken.org/blog/tag/memory/feed/json", "language": "ja", "title": "memory – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "http://matoken.org/blog/?p=3310", "url": "https://matoken.org/blog/2021/07/17/linux-ram-limit/", "title": "Linux\u306eRAM\u3092\u5236\u9650\u3059\u308b\u30e1\u30e2", "content_html": "
Linux\u3067RAM\u306e\u5c11\u306a\u3044\u72b6\u614b\u306e\u30c6\u30b9\u30c8\u3092\u3057\u305f\u3044\u306a\u3068\u601d\u3063\u3066\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u30e1\u30e2\u30ea\u5236\u9650\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
\n\u7269\u7406RAM\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5236\u9650\u3057\u305f\u3044\u5bb9\u91cf\u306b\u523a\u3057\u76f4\u3059\u3053\u3068\u304c\u3067\u304d\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u304c\uff0c\u90fd\u5408\u306e\u826f\u3044\u30b5\u30a4\u30ba\u306eRAM\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3042\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\uff0eLinux\u306e\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u5236\u9650\u3067\u304d\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
\nLinux\u30de\u30b7\u30f3\u3092\u8d77\u52d5\u3057\u3066\uff0cGRUB\u306e\u30e1\u30cb\u30e5\u30fc\u3067\u7de8\u96c6\u3057\u305f\u3044\u30a8\u30f3\u30c8\u30ea\u3092\u77e2\u5370\u4e0a\u4e0b\u30ad\u30fc\u3067\u9078\u629e\u3057\u3066\uff0c e \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u7de8\u96c6\u30e1\u30cb\u30e5\u30fc\u306b\u5165\u308a\u307e\u3059\uff0e
\nlinux /vmlinuz\u301c \u3068\u3044\u3063\u305f\u884c\u306b\u79fb\u52d5\u3057\u3066\u672b\u5c3e\u306b\u8ffd\u52a0\u306e\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u8a18\u3057\u307e\u3059\uff0e\u4eca\u56de\u306f\u30e1\u30e2\u30ea\u30922GB\u306b\u5236\u9650\u3057\u305f\u3044\u306e\u3067\uff0c mem=2048m \u3092\u6307\u5b9a\u3057\u307e\u3059\uff0e(\u5b9f\u30e1\u30e2\u30ea\u4ee5\u4e0a\u306b\u3082\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u304c\u305d\u3053\u3092\u4f7f\u304a\u3046\u3068\u3057\u305f\u3068\u304d\u306b\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u305d\u3046\u3067\u3059\u306d)
linux /vmlinuz-5.13.2-mptcp+le9 root=/dev/mapper/yoga\u2014\u200b260\u2014\u200bvg-root rolinux /vmlinuz-5.13.2-mptcp+le9 root=/dev/mapper/yoga\u2014\u200b260\u2014\u200bvg-root ro mem=2048mCtrl + x \u3092\u62bc\u3057\u3066\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u8d77\u52d5\u3057\u307e\u3059\uff0e
\u8d77\u52d5\u3057\u305f\u3089\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\uff0e
\n$ cat /proc/cmdline (1)\nBOOT_IMAGE=/vmlinuz-5.13.2-mptcp+le9 root=/dev/mapper/yoga--260--vg-root ro mem=2048m\n$ head -1 /proc/meminfo (2)\nMemTotal: 2032968 kB\n$ free (3)\n total used free shared buff/cache available\nMem: 2032968 1575032 70032 161360 387904 139588\nSwap: 0 0 0\n2GB\u306b\u5236\u9650\u3067\u304d\u305f\u3088\u3046\u3067\u3059 :)
\n\u8a73\u7d30\u306fKernel\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092
\nmem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory\n Amount of memory to be used in cases as follows:\n\n 1 for test;\n 2 when the kernel is not able to see the whole system memory;\n 3 memory that lies after 'mem=' boundary is excluded from\n the hypervisor, then assigned to KVM guests.\n\n [X86] Work as limiting max address. Use together\n with memmap= to avoid physical address space collisions.\n Without memmap= PCI devices could be placed at addresses\n belonging to unused RAM.\n\n Note that this only takes effects during boot time since\n in above case 3, memory may need be hot added after boot\n if system memory of hypervisor is not sufficient.\n
\u4eca\u56de\u306e\u624b\u9806\u306f\u30a2\u30c9\u30db\u30c3\u30af\u306a\u624b\u9806\u3067\u518d\u8d77\u52d5\u3059\u308c\u3070\u5143\u306b\u623b\u3063\u3066\u3057\u307e\u3044\u307e\u3059\uff0e\u3082\u3057\u6c38\u7d9a\u5316\u3057\u305f\u3044\u306e\u3067\u3042\u308c\u3070\uff0c grub.cfg \u3092\u66f8\u304d\u63db\u3048\u308c\u3070OK\u306a\u306f\u305a\u3067\u3059\uff0e\u4eca\u56de\u306eDebian Bullseye \u306e\u5834\u5408\u306f\uff0c /etc/grub.d/10_linux \u3092\u7de8\u96c6\u3057\u3066 sudo update-grub2 \u306e\u5b9f\u884c\u3067 /boot/grub/grub.cfg \u304c\u66f4\u65b0\u3055\u308c\u307e\u3059\uff0e
$ dpkg-query -W grub2* linux-image-`uname -r` procps\ngrub2\ngrub2-common 2.04-19\nlinux-image-5.13.2-mptcp+le9 5.13.2-mptcp+le9-3\nprocps 2:3.3.17-5\n$ lsb_release -dr\nDescription: Debian GNU/Linux 11 (bullseye)\nRelease: 11\n$ arch\nx86_64\n