LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mono: Segmentation fault (https://www.linuxquestions.org/questions/linux-software-2/mono-segmentation-fault-769339/)

toredo 11-15-2009 05:06 PM

mono: Segmentation fault
 
Hello,

I wrote a small tool in C#. it's a console-tool and it uses 3 dll's, on my windows-pc it works fine.

i recompiled it with monodevelop on a debian, no problems, and it runs there perfectly, too.

the tool is for a embedded arm-board (sam9-l9260), it has 64MB ram and a 300MB swap-partition. normaly are ~20MB used. if i start my tool without arguments, there showa an error: "invalid argments". no problems, thats right.

and if i start the tool with valid arguments, it works, and the ram is going to be filled. and if the ram is filled, mono shows an error "segmentation fault". but i have 300mB free swap:( why it didnt use it?

the next problem is, why the tool uses so much ram? it's a small tool, which exports data from a sqlite3-database to a xml. on a pc the tool needs ~1sec for his work. ok, the arm-board is much slower but here i wait 20sec, then it crashes...

have someone an idea? can i run the tool only in the swap? it's no problem if the tool need 1min to run. i only run it all 2-5 days.

best regards
toredo

paulsm4 11-15-2009 07:26 PM

Hi -

Unfortunately, .Net is a memory pig. And the Mono implementation of .Net tends to be PQ ("Pig Quebed ;)).

Suggestion: compare a Mono "hello world" with an equivalent Java "hello world", assuming you have access to a JRE for your device. I think you might be astonished at the difference!

PS:
There's always C/C++ ;)!

PPS:
You should *never* rely on swap, if you can at *all* avoid it. This is equally true of Linux or Windows; of desktops or embedded devices. Once you run out of RAM and start hitting your swapfile ... you're going to start encountering all KINDS of problems - high latency, high CPU utilization, huge performance hits ... and random problems like the odd segmentation fault here or there. Unfortunate, but true.

toredo 11-16-2009 03:22 AM

hello,

thx for the answer:) yes, i know that mono needs much ram, but i thought not so much:) shit happens...

c/c++, the languages are ok, but if i work with xml and databases i normally use c# (under windows) and on linux perl.

so i'll work now with perl. :( i'm gutted about mono, because 40mb free ram in normally enough to run so a small console-tool.

and ok;) i'll try to never use my swap:)

thx

best regards
toredo


All times are GMT -5. The time now is 06:22 AM.