How to change Android max file open limit per user/process

981 views
Skip to first unread message

Din Assegaf

unread,
Feb 22, 2021, 7:03:39 PM2/22/21
to android-platform
I try to do stop; and start; again android but stuck at too many open files error,


X00TD:/# cat /proc/self/limits                                      
Limit                     Soft Limit           Hard Limit           Units     
Max processes             10077                10077                processes 
Max open files            1024                 4096                 files     


1|X00TD:/# ulimit -a
...
-n: nofiles(descriptors)  1024

I want to try to modify android kernel config/settings, source code too if possible, but this config is not exist : 

X00TD:/ # ls /system/etc/security/limits.conf                        
ls: /system/etc/security/limits.conf: No such file or directory

1|X00TD:/ # ls /etc/security/limits.conf                             
ls: /etc/security/limits.conf: No such file or directory

how to change the limit 1024 of that ?

Jacik

unread,
Feb 28, 2021, 3:20:11 PM2/28/21
to android-platform
Hi,

You could try to use init.rc  setrlimit  command

Maybe there are parameters which will allow to change that limit.
I was able to modify NICE parameter to run my process as realtime

Example:
"[Set Resource Limit]" # set RLIMIT_NICE to allow priorities from 19 to -20 
 setrlimit 13 40 40  
Reply all
Reply to author
Forward
0 new messages