Hey Shawn,

What does your web stack and environment look like? If it's failing during
a fork with an out of memory, that makes me wonder if the host process for
django is consuming a chunk of memory for some reason, and when it gets
forked, it'll get replicated over (which supposedly would fail, even with
copy on write, with certain OS settings - I'm far from an expert in this
area). Have you tested this code on another machine to see if it exhibits
the same behavior?
-Nick

On Tue, Mar 11, 2014 at 5:07 PM, Shawn Milochik <shawn.m...@gmail.com>wrote:

> Hi Russ, thanks for the reply.
>
> What I mean by "under Django" is if I call it from within a view or with
> "manage.py shell" I get the problem. On the system in question, "manage.py
> shell" does in fact invoke iPython. However, invoking iPython manually
> (without manage.py) works. Executing the script stand-alone works.
>
> I tried to circumvent the entire problem by adding an "if __name__ ==
> '__main__'" block to the script and having it take a command-line argument
> via argparse and print the desired output. Then I did a
> subprocess.check_output call on *that* instead of importing the module.
> This worked from "manage.py shell," but not within a view in Django -- the
> same OS error 12.
>
> The error happens in a call to os.fork within the subprocess.call or
> subprocess.check_output methods (I tried both). The traceback is here:
> http://bpaste.net/show/NRYtgvzoqyOBawl6XoxY/
>
> I'm going to have to keep poking at it, but I was really hoping someone
> had encountered this before. I did see some cases via Google on forums and
> StackOverflow where people reported the problem, but there were no answers
> other than directly addressing the amount of memory required, but I'm
> pretty sure this script isn't consuming much memory. Even when it's not
> running ls, it's just doing a subprocess call to gpg to sign and encrypt a
> file. It takes well under one second.
>
> Thanks for looking at it.
> Shawn
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOzwKwFtAFocN0riTpViRhwRxTuvGR4dX6T53ToQdwJHZAr7bQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAOzwKwFtAFocN0riTpViRhwRxTuvGR4dX6T53ToQdwJHZAr7bQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM1S3vCbZbpQzxfmDDZYFOGsF7MWQYwJHs80aob2zaTAJ_5s0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to