Note that there are some explanatory texts on larger screens.

plurals
  1. POMono crashes when running too many processes
    primarykey
    data
    text
    <p>I want to build a video converting queue, so servers running a mono program, extracts a video from queue and runs ffmpeg to convert it. When running many ffmpeg processses mono gives me error.</p> <p>So i created a test case with ping because it's a long running one as ffmpeg.</p> <pre><code> static TextWriter tw = new StreamWriter("error.txt"); private static int _started; public static void Main (string[] args) { for (int i=0; i&lt;1000; i++) { Start ("ping", "localhost"); } Console.WriteLine("Memory: " + (GC.GetTotalMemory(true) / 1024) + "KB"); Console.WriteLine(_started); tw.Flush(); Console.ReadLine(); } public static Process Start (string name, string args) { try { var proc = new ProcessStartInfo { FileName = name, Arguments = args, RedirectStandardOutput = true, CreateNoWindow = false, RedirectStandardError = false, UseShellExecute = false, RedirectStandardInput = false, }; Process.Start (proc); _started++; } catch (Exception ex) { tw.WriteLine (ex.InnerException+Environment.NewLine+ex.Message + Environment.NewLine + ex.StackTrace, false); tw.Flush(); } return null; } </code></pre> <p>And when running, the same error throws as in the case with ffmpeg</p> <pre><code>ApplicationName='ping', CommandLine='localhost', CurrentDirectory='' at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in &lt;filename unknown&gt;:0 at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in &lt;filename unknown&gt;:0 at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in &lt;filename unknown&gt;:0 at test1.MainClass.Start (System.String name, System.String args) [0x00000] in &lt;filename unknown&gt;:0 </code></pre> <p>and </p> <blockquote> <p>CreateProcess: error creating process handle</p> </blockquote> <p>So that's my environment:</p> <pre><code>Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: Included Boehm (with typed GC and Parallel Mark) </code></pre> <p>And limit values</p> <pre><code>core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31439 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31439 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited </code></pre> <p>I want to continue my project but i can't because of this anomalies, after working 1 year with mono i really love it, and don't want to learn other language because of this trouble.</p> <p>I hope there is a problem with my code, not mono runtime.</p> <p><strong>So my temporary solution:</strong></p> <pre><code> public static void Start (string cmd, int time) { new Thread (p =&gt; { try { Mono.Unix.Native.Syscall.system (String.Format("timeout {0} {1}", time, cmd)); } catch (Exception ex) { //log it } } ).Start (); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload