how to resolve logging out of memory error?










0















I am getting above error in my docker container which only has automation scripts(python 2.7.11) and to log errors i am using logging package.



Traceback (most recent call last):

File "/usr/lib/python2.7/logging/__init__.py", line 885, in emit
self.flush()

File "/usr/lib/python2.7/logging/__init__.py", line 845, in flush
self.stream.flush()
IOError: [Errno 12] Out of memory


else i see below error as launch_err
I got above error as launch_err for that docker container and all i see in log is this
"(:[Errno 12] Out of memory [/usr/lib/python2.7/site-packages/supervisor/supervisord.py|runforever|235] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|handle_read_event|232] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|record_output|166] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|_log|142] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|info|275] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|log|293] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|emit|86] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|handleError|90]



that container has 1GB mem , i tried increasing upto 4GB but it still crashes and logs same error. I believe its memory leak from logging package where its not able to release handlers to flush buffers.










share|improve this question



















  • 1





    Only two things to do when running out of memory - get more or use less.

    – roeen30
    Nov 14 '18 at 23:19






  • 1





    It's very hard to see where your code is using so much memory if you don't post it.

    – Tomothy32
    Nov 14 '18 at 23:19











  • Can you read through /var/log/messages ? (use less /var/log/messages)

    – JacobIRR
    Nov 14 '18 at 23:21
















0















I am getting above error in my docker container which only has automation scripts(python 2.7.11) and to log errors i am using logging package.



Traceback (most recent call last):

File "/usr/lib/python2.7/logging/__init__.py", line 885, in emit
self.flush()

File "/usr/lib/python2.7/logging/__init__.py", line 845, in flush
self.stream.flush()
IOError: [Errno 12] Out of memory


else i see below error as launch_err
I got above error as launch_err for that docker container and all i see in log is this
"(:[Errno 12] Out of memory [/usr/lib/python2.7/site-packages/supervisor/supervisord.py|runforever|235] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|handle_read_event|232] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|record_output|166] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|_log|142] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|info|275] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|log|293] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|emit|86] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|handleError|90]



that container has 1GB mem , i tried increasing upto 4GB but it still crashes and logs same error. I believe its memory leak from logging package where its not able to release handlers to flush buffers.










share|improve this question



















  • 1





    Only two things to do when running out of memory - get more or use less.

    – roeen30
    Nov 14 '18 at 23:19






  • 1





    It's very hard to see where your code is using so much memory if you don't post it.

    – Tomothy32
    Nov 14 '18 at 23:19











  • Can you read through /var/log/messages ? (use less /var/log/messages)

    – JacobIRR
    Nov 14 '18 at 23:21














0












0








0








I am getting above error in my docker container which only has automation scripts(python 2.7.11) and to log errors i am using logging package.



Traceback (most recent call last):

File "/usr/lib/python2.7/logging/__init__.py", line 885, in emit
self.flush()

File "/usr/lib/python2.7/logging/__init__.py", line 845, in flush
self.stream.flush()
IOError: [Errno 12] Out of memory


else i see below error as launch_err
I got above error as launch_err for that docker container and all i see in log is this
"(:[Errno 12] Out of memory [/usr/lib/python2.7/site-packages/supervisor/supervisord.py|runforever|235] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|handle_read_event|232] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|record_output|166] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|_log|142] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|info|275] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|log|293] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|emit|86] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|handleError|90]



that container has 1GB mem , i tried increasing upto 4GB but it still crashes and logs same error. I believe its memory leak from logging package where its not able to release handlers to flush buffers.










share|improve this question
















I am getting above error in my docker container which only has automation scripts(python 2.7.11) and to log errors i am using logging package.



Traceback (most recent call last):

File "/usr/lib/python2.7/logging/__init__.py", line 885, in emit
self.flush()

File "/usr/lib/python2.7/logging/__init__.py", line 845, in flush
self.stream.flush()
IOError: [Errno 12] Out of memory


else i see below error as launch_err
I got above error as launch_err for that docker container and all i see in log is this
"(:[Errno 12] Out of memory [/usr/lib/python2.7/site-packages/supervisor/supervisord.py|runforever|235] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|handle_read_event|232] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|record_output|166] [/usr/lib/python2.7/site-packages/supervisor/dispatchers.py|_log|142] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|info|275] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|log|293] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|emit|86] [/usr/lib/python2.7/site-packages/supervisor/loggers.py|handleError|90]



that container has 1GB mem , i tried increasing upto 4GB but it still crashes and logs same error. I believe its memory leak from logging package where its not able to release handlers to flush buffers.







python logging






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 23:29







J.2025

















asked Nov 14 '18 at 23:13









J.2025J.2025

12




12







  • 1





    Only two things to do when running out of memory - get more or use less.

    – roeen30
    Nov 14 '18 at 23:19






  • 1





    It's very hard to see where your code is using so much memory if you don't post it.

    – Tomothy32
    Nov 14 '18 at 23:19











  • Can you read through /var/log/messages ? (use less /var/log/messages)

    – JacobIRR
    Nov 14 '18 at 23:21













  • 1





    Only two things to do when running out of memory - get more or use less.

    – roeen30
    Nov 14 '18 at 23:19






  • 1





    It's very hard to see where your code is using so much memory if you don't post it.

    – Tomothy32
    Nov 14 '18 at 23:19











  • Can you read through /var/log/messages ? (use less /var/log/messages)

    – JacobIRR
    Nov 14 '18 at 23:21








1




1





Only two things to do when running out of memory - get more or use less.

– roeen30
Nov 14 '18 at 23:19





Only two things to do when running out of memory - get more or use less.

– roeen30
Nov 14 '18 at 23:19




1




1





It's very hard to see where your code is using so much memory if you don't post it.

– Tomothy32
Nov 14 '18 at 23:19





It's very hard to see where your code is using so much memory if you don't post it.

– Tomothy32
Nov 14 '18 at 23:19













Can you read through /var/log/messages ? (use less /var/log/messages)

– JacobIRR
Nov 14 '18 at 23:21






Can you read through /var/log/messages ? (use less /var/log/messages)

– JacobIRR
Nov 14 '18 at 23:21













1 Answer
1






active

oldest

votes


















0














Root cause was we were using epoch date function inside shell script which was being called every second. That caused hogging.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310163%2fhow-to-resolve-logging-out-of-memory-error%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Root cause was we were using epoch date function inside shell script which was being called every second. That caused hogging.






    share|improve this answer



























      0














      Root cause was we were using epoch date function inside shell script which was being called every second. That caused hogging.






      share|improve this answer

























        0












        0








        0







        Root cause was we were using epoch date function inside shell script which was being called every second. That caused hogging.






        share|improve this answer













        Root cause was we were using epoch date function inside shell script which was being called every second. That caused hogging.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 11 at 1:45









        J.2025J.2025

        12




        12





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310163%2fhow-to-resolve-logging-out-of-memory-error%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3

            Museum of Modern and Contemporary Art of Trento and Rovereto