How to write java program to increase file limit using ulimit

Posted by Sunil Kumar Sahoo on Stack Overflow See other posts from Stack Overflow or by Sunil Kumar Sahoo
Published on 2010-05-19T13:09:42Z Indexed on 2010/05/19 13:30 UTC
Read the original article Hit count: 302

Filed under:
|

I am using Fedora linux where ulimit -n 10000 increases file limit upto 10000. I want to achieve the same using java program

How to write java program to increase file limit using ulimit I have tried with the below program but it didnot work well. The program didnot give any error. but didnot increase file limit also

public class IncreaseFIle {
    public static void main(String[] args) {

       String command = "/bin/bash ulimit -n 10000";
//        String command = "pwd";
        try {
            Runtime.getRuntime().exec(command);

        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

Thanks Sunil Kumar Sahoo

© Stack Overflow or respective owner

Related posts about java

Related posts about exec