Too many open files
The embedded Derby database, which can be used instead of the H2 database, opens several file handles and may run over the maximum limit set by the system. This issue can occur on some UNIX-based systems.
The solution is to increase the system-wide limit on the number of open files. The exact procedure, however, varies from one OS to another.
Ubuntu Linux
-
Find the current maximum number of open files per user in a single session:
ulimit -nThe number is
1024by default, which is too small.A value higher than 1048576(from Ubuntu LTS 24.01) is recommended. -
Edit the
limits.conffile:sudo gedit /etc/security/limits.conf -
Add the following lines to the file:
* soft nofile 10000 * hard nofile 50000This sets for all users a soft limit of 10000 open files and a hard limit of
50000. These are just examples. Set the limit according to your needs.The wildcard option applies only to regular users, not to superuser. If you run Magnolia assuperuser, replace the asterisk withroot. -
Save the file.
-
Edit the configuration file for session-related modules:
sudo gedit /etc/pam.d/common-session -
Add the following line to the file:
session required pam_limits.soYou may need to add the following line to
/etc/systemd/system.confand/etc/systemd/user.conf:DefaultLimitNOFILE=65535 -
Save the file.
-
Restart Ubuntu.
-
Verify the new maximum number of open files:
ulimit -nThe command should now return
10000.
OS X 14.x
-
Find the current maximum number of open files per user in a single session:
ulimit -nThe number is 256 by default, which is too small.
To check the current limits on your Mac OS X system, run the following:
launchctl limit maxfilesThe last two columns are the soft and hard limits, respectively.
-
Add
ulimit -n 65536to your~/.profilefile. This increases the limit for the shell. -
Create a
/etc/sysctl.conffile if it does not exist. -
Add the following lines to
/etc/sysctl.conf:kern.maxfiles=65536 kern.maxfilesperproc=65536This increases the limit for the kernel.
-
Open a terminal and type:
sudo sysctl -w kern.maxfiles=65536 sudo sysctl -w kern.maxfilesperproc=65536 sudo ulimit -n 65536Or restart your system to read the settings from the files you edited.
-
Type
ulimit -n. The response should be65536(if not, restart your system). -
Install Magnolia
See Shell session limit and this thread for information on previous Mac OS versions.
|
The instructions above apply to Bash shell, not Zsh. |