ulimit -n shows different values in mac terminal and intellij terminal I have tried increasing the max open files limit in mac by running the following command
sudo launchctl limit maxfiles 524288 10485760
When I try running ulimit -n it shows 524288
But while running the same command in IntelliJ idea's terminal it shows 10240

I've tried reinstalling IntelliJ idea
I've tried restarting IntelliJ after invalidating cache and restarting
I've restarted the system multiple times.

Please let me know how to fix this issue.
The problem is caused by IntelliJ being a Java program that is subject to the constraints of the Java virtual machine, which by default on macOS is set to limit the number of open files to 10240 - no matter which setting is used elsewhere in the operating system.
The solution is as follows:

Add -XX:-MaxFDLimit in IntelliJ Idea (Help-&gt;Edit Custom VM options)
Invalidate cache and restart IntelliJ

This removes the arbitrary 10240 limit on the Java virtual machine, and makes it so that IntelliJ is instead only limited by the general macOS open files limit - like any other program.