<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>macOS on あんぜんぴんの落書き帳</title>
    <link>https://annpin.com/tags/macos/</link>
    <description>Recent content in macOS on あんぜんぴんの落書き帳</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>ja</language>
    <copyright>© 2018-2024. All rights reserved.</copyright>
    <lastBuildDate>Fri, 16 May 2025 04:57:40 +0900</lastBuildDate><atom:link href="https://annpin.com/tags/macos/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>macOS で Neovim を使っているときに発生する Too many open files エラーを解決する</title>
      <link>https://annpin.com/posts/2025-05-16-20250516-045804macos-too-many-open-files-error/</link>
      <pubDate>Fri, 16 May 2025 04:57:40 +0900</pubDate>
      
      <guid>https://annpin.com/posts/2025-05-16-20250516-045804macos-too-many-open-files-error/</guid>
      <description>しばらく前から macOS 上で LSP を有効にして Neovim で開発を行っていると、唐突に
Process failed to start: too many open files: ... と表示され、その後ファイルの保存も何もできなくなるという問題が発生していた.
どうやら原因は macOS 自体の「ファイルを開ける最大数」の設定だったようだ.
ターミナル上で launchctl を用いて設定を確認してみる.
$ launchctl limit cpu unlimited unlimited filesize unlimited unlimited data unlimited unlimited stack 8372224 67092480 core 0 unlimited rss unlimited unlimited memlock unlimited unlimited maxproc 10666 16000 maxfiles 256 unlimited ということで maxfiles は 256 (デフォルト) に設定されている. 左側に表示されている値が &amp;#34;ソフトリミット&amp;#34; で、右側に表示されている値が &amp;#34;ハードリミット&amp;#34; であるとのこと.
基本的にはソフトリミットの上限値が適用されているらしく、この値を変更すれば良いらしい.
/Library/LaunchDaemons/limit.maxfiles.plist というファイルを作成し、そこに更新後の maxfiles の値を書いておく. (このファイルはデフォルトでは存在しないらしいので、新規に作成する必要がある.</description>
    </item>
    
  </channel>
</rss>
