将linux内存设置为unlimit会产生不利影响吗?

时间:2018-08-27 01:37:49

标签: linux linux-kernel

我正在linux服务器中运行MPI作业。我收到错误消息:

--------------------------------------------------------------------------
The OpenFabrics (openib) BTL failed to initialize while trying to
allocate some locked memory.  This typically can indicate that the
memlock limits are set too low.  For most HPC installations, the
memlock limits should be set to "unlimited".  The failure occured
here:

Local host:    yw0431
OMPI source:   ../../../../../ompi/mca/btl/openib/btl_openib_component.c:1216
Function:      ompi_free_list_init_ex_new()
Device:        mlx4_0
Memlock limit: 65536

You may need to consult with your system administrator to get this
problem fixed.  This FAQ entry on the Open MPI web site may also be
helpful:

 http://www.open-mpi.org/faq/?category=openfabrics#ib-locked-pages 
 --------------------------------------------------------------------------
 --------------------------------------------------------------------------
WARNING: There was an error initializing an OpenFabrics device.

Local host:   yw0431
Local device: mlx4_0
--------------------------------------------------------------------------
[yw0431:20193] 11 more processes have sent help message help-mpi-btl-openib.txt / init-fail-no-mem
[yw0431:20193] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
[yw0431:20193] 11 more processes have sent help message help-mpi-btl-openib.txt / error in device init
 forrtl: error (78): process killed (SIGTERM)

这意味着我的linux服务器已将内存锁定为65M,但是我的工作需要更多的内存。我认为2G应该足够了。

我找到了有关限制内存的解决方案:

 ulimit -l unlimited

但是我担心会导致系统崩溃或发生一些不好的事情。

那么我可以设置“ ulimit -l umlimited”吗?

1 个答案:

答案 0 :(得分:0)

当您将ulimit设置为无限制,并且您的进程开始完全使用内存时,OOM杀手将杀死您的工作以提高系统稳定性,我会将ulimit设置为RAM的80%到90%,而不是无限制。