I believe this is correct.

Changing the vm.overcommit settings seemed to solve the problem. Bounty Closed.

There are other problems in the system as well, but now I'm actually able to debug them rather than getting oom panics inbetween.

AJ ONeal


On Mon, Dec 20, 2010 at 12:57 AM, Robert Vogt IV <robert@iosix.com> wrote:
Hi Cole,

I believe from my experiments with the ramdisk that the system is
sparse - that is, the memory is only used if it is used on the
ramdisk, otherwise it is free.  When I reduced available memory to
80MB to do some DSP work, the default config still created a "120MB"
ramdisk, which, of course, couldn't be really used to that level...


Robert Vogt IV
CEO
IOSiX, LLC
2375 Parkwood Ave
Ypsilanti, MI  48198
robert@iosix.com
P: 734-730-9690
F: 734-482-2337



On Mon, Dec 20, 2010 at 2:06 AM, Cole Christensen
<cole.christensen@gmail.com> wrote:
> AJ
>
> The reason that it seems you can only use half of your physical ram is that
> exactly one half is allocated to a tmpfs "ram disk."  This is done for good
> reason.  CF and especially NAND memory is slow to write, and lots of
> processes like writing temporary files, sometimes very often causing
> unneeded writes on a limited lifetime medium, and slow performance.
>
> You are trying to use more memory than you have.
>
> You can sure turn off overcommit, but that doesn't solve any problems.  The
> programs you are running are using more RAM than you have... 80 MB or 160 MB
> just isn't very much.  Turning off overcommit will just give you different
> errors, it doesn't reduce your need of memory.
>
> So you have a few solutions with various pro's and cons.
>
> * Determine what's eating up all of your memory and try to trim down.
> Embedded platforms have limitations, you'll have to deal with them.
> * Reduce or eliminate the size of the tmpfs.  If it's too small you will run
> into out-of-space disk errors. If you eliminate tmpfs entirely your system
> will be slower, probably significantly.
> * Create a swap partition and enable it.  Swap is slow, quite slow.  It also
> creates the previously mentioned disk wear problems.
>
> Whatever you do, you risk performance hits.  Reducing the tmpfs is probably
> your best option along with trying to trim down memory usage, but your
> limitations are still going to be very tight.
>
>
> - Cole Christensen
>
>
>
>
> On Sun, Dec 19, 2010 at 5:49 PM, AJ ONeal <coolaj86@gmail.com> wrote:
>>
>> Yes, that's what I set it to after reading those links.
>>
>> Shouldn't Gumstix have an overlay sysctl.conf for this?
>>
>> It ships with swap off so I would have thought that more people would have
>> noticed this.
>>
>> But then again, maybe I'm an oddity in not knowing to check that setting
>> in the first place.
>>
>> AJ ONeal
>>
>>
>> On Sun, Dec 19, 2010 at 10:33 AM, Brad Midgley <bmidgley@gmail.com> wrote:
>>>
>>> AJ,
>>>
>>> Are you finding it's safe to have 100 in /proc/sys/vm/overcommit_ratio
>>> when there's no swap space? The 80 I see people recommend might not
>>> make sense without swap.
>>>
>>> that would be
>>>
>>> # echo 2 > /proc/sys/vm/overcommit_memory
>>> # echo 100 > /proc/sys/vm/overcommit_ratio
>>>
>>> So the oom checks these values when it decides how to do its job?
>>>
>>> Brad
>>>
>>> On Sat, Dec 18, 2010 at 6:48 PM, AJ ONeal <coolaj86@gmail.com> wrote:
>>> > I don't know, but none of the processes are using 50% of the memory.
>>> >
>>> > In total they're using 50%.
>>> >
>>> > I think I may have found the answer though:
>>> >
>>> > http://www.hskupin.info/2010/06/17/how-to-fix-the-oom-killer-crashe-under-linux/
>>> > http://www.win.tue.nl/~aeb/linux/lk/lk-9.html#ss9.6
>>> >
>>> > The kernel allows all processes to use 50% of RAM + Swap by default.
>>> > Gumstix ship without swap, but with the default setting in the kernel.
>>> >
>>> > If this isn't the fix, the bounty is still open, I'll be testing in a
>>> > few
>>> > minutes.
>>> >
>>> > AJ ONeal
>>> >
>>> >
>>> > On Sat, Dec 18, 2010 at 6:31 PM, Pat Suwalski <pat@suwalski.net> wrote:
>>> >>
>>> >> A user process is only allowed to use 50% of available physical
>>> >> memory,
>>> >> isn't it?
>>> >>
>>> >> --Pat
>>> >>
>>> >> On 10-12-18 08:16 PM, AJ ONeal wrote:
>>> >> > I've got htop up and I'm watching memory usage I was using a mere
>>> >> > 80mb
>>> >> > of an available 160mb
>>> >> >
>>> >> > I keep getting segfaults over and over and over again.
>>> >> > I've gotten them from ffmpeg, ls, node. I've tried kernel 2.6.34 and
>>> >> > 2.6.36.
>>> >> >
>>> >> > If you can give me the solution to how I get my system to give me
>>> >> > the
>>> >> > full 160mb I deserve,
>>> >> > you'll get $150 that you deserve.
>>> >> >
>>> >> > I can do paypal, wire transfer, however you would like it in the
>>> >> > currency of your choice.
>>> >> >
>>> >> >
>>> >> > sh invoked oom-killer: gfp_mask=0xd0, order=2, oom_adj=0
>>> >> > [<c00385c8>] (unwind_backtrace+0x0/0xec) from [<c0095eec>]
>>> >> > (dump_header+0x3c/0x108)
>>> >> > [<c0095eec>] (dump_header+0x3c/0x108) from [<c0095ff4>]
>>> >> > (oom_kill_process+0x3c/0xf8)
>>> >> > [<c0095ff4>] (oom_kill_process+0x3c/0xf8) from [<c00964cc>]
>>> >> > (__out_of_memory+0x15c/0x180)
>>> >> > [<c00964cc>] (__out_of_memory+0x15c/0x180) from [<c009657c>]
>>> >> > (out_of_memory+0x8c/0xc0)
>>> >> > [<c009657c>] (out_of_memory+0x8c/0xc0) from [<c00991fc>]
>>> >> > (__alloc_pages_nodemask+0x430/0x530)
>>> >> > [<c00991fc>] (__alloc_pages_nodemask+0x430/0x530) from [<c0099310>]
>>> >> > (__get_free_pages+0x14/0x44)
>>> >> > [<c0099310>] (__get_free_pages+0x14/0x44) from [<c003ba88>]
>>> >> > (get_pgd_slow+0x18/0xe8)
>>> >> > [<c003ba88>] (get_pgd_slow+0x18/0xe8) from [<c0058c7c>]
>>> >> > (mm_init+0x94/0xd4)
>>> >> > [<c0058c7c>] (mm_init+0x94/0xd4) from [<c00591fc>]
>>> >> > (dup_mm+0x60/0x3b0)
>>> >> > [<c00591fc>] (dup_mm+0x60/0x3b0) from [<c0059c10>]
>>> >> > (copy_process+0x624/0xba8)
>>> >> > [<c0059c10>] (copy_process+0x624/0xba8) from [<c005a2ec>]
>>> >> > (do_fork+0x158/0x310)
>>> >> > [<c005a2ec>] (do_fork+0x158/0x310) from [<c0033f00>]
>>> >> > (ret_fast_syscall+0x0/0x30)
>>> >> > Mem-info:
>>> >> > Normal per-cpu:
>>> >> > CPU    0: hi:   42, btch:   7 usd:   0
>>> >> > active_anon:17334 inactive_anon:17901 isolated_anon:20
>>> >> >   active_file:14 inactive_file:11 isolated_file:13
>>> >> >   unevictable:0 dirty:0 writeback:0 unstable:0
>>> >> >   free:4016 slab_reclaimable:603 slab_unreclaimable:882
>>> >> >   mapped:199 shmem:18044 pagetables:180 bounce:0
>>> >> > Normal free:16064kB min:1688kB low:2108kB high:2532kB
>>> >> > active_anon:69336kB inactive_anon:71604kB aco
>>> >> > lowmem_reserve[]: 0 0
>>> >> > Normal: 1982*4kB 981*8kB 8*16kB 1*32kB 2*64kB 0*128kB 0*256kB
>>> >> > 0*512kB
>>> >> > 0*1024kB 0*2048kB 0*4096kB =B
>>> >> > 18079 total pagecache pages
>>> >> > 0 pages in swap cache
>>> >> > Swap cache stats: add 0, delete 0, find 0/0
>>> >> > Free swap  = 0kB
>>> >> > Total swap = 0kB
>>> >> > 45056 pages of RAM
>>> >> > 4207 free pages
>>> >> > 2863 reserved pages
>>> >> > 1485 slab pages
>>> >> > 428 pages shared
>>> >> > 0 pages swap cached
>>> >> > Out of memory: kill process 841 (hald) score 3814 or a child
>>> >> > Killed process 909 (hald-runner) vsz:3264kB, anon-rss:160kB,
>>> >> > file-rss:0kB
>>> >> >
>>> >> >
>>> >> > AJ ONeal
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > ------------------------------------------------------------------------------
>>> >> > Lotusphere 2011
>>> >> > Register now for Lotusphere 2011 and learn how
>>> >> > to connect the dots, take your collaborative environment
>>> >> > to the next level, and enter the era of Social Business.
>>> >> > http://p.sf.net/sfu/lotusphere-d2d
>>> >> >
>>> >> >
>>> >> >
>>> >> > _______________________________________________
>>> >> > gumstix-users mailing list
>>> >> > gumstix-users@lists.sourceforge.net
>>> >> > https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> ------------------------------------------------------------------------------
>>> >> Lotusphere 2011
>>> >> Register now for Lotusphere 2011 and learn how
>>> >> to connect the dots, take your collaborative environment
>>> >> to the next level, and enter the era of Social Business.
>>> >> http://p.sf.net/sfu/lotusphere-d2d
>>> >> _______________________________________________
>>> >> gumstix-users mailing list
>>> >> gumstix-users@lists.sourceforge.net
>>> >> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>> >
>>> >
>>> >
>>> > ------------------------------------------------------------------------------
>>> > Lotusphere 2011
>>> > Register now for Lotusphere 2011 and learn how
>>> > to connect the dots, take your collaborative environment
>>> > to the next level, and enter the era of Social Business.
>>> > http://p.sf.net/sfu/lotusphere-d2d
>>> > _______________________________________________
>>> > gumstix-users mailing list
>>> > gumstix-users@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Brad Midgley
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Lotusphere 2011
>>> Register now for Lotusphere 2011 and learn how
>>> to connect the dots, take your collaborative environment
>>> to the next level, and enter the era of Social Business.
>>> http://p.sf.net/sfu/lotusphere-d2d
>>> _______________________________________________
>>> gumstix-users mailing list
>>> gumstix-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> gumstix-users mailing list
>> gumstix-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>>
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> gumstix-users mailing list
> gumstix-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gumstix-users
>
>

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users