0

I have a python script which usually executes for about 25 minutes locally or at Ubuntu server

I start it by command:

python3 /home/mluser/Model_building/main.py

The process executes fine.

But whe I add it to crontab, it is being killed somewhere at the middle of a process.

oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/cron.service,task=python3,pid=173805,uid=1001
Out of memory: Killed process 173805 (python3) total-vm:5394612kB, anon-rss:4876940kB, file-rss:32kB, shmem-rss:0kB, UID:1001 pgtables:9852kB oom_score_adj:0
oom_reaper: reaped process 173805 (python3), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

We have 16 GB RAM at server, the same as my local PC. I've tried logging RAM usage, but before the collapse its more than 50% of RAM is free.

Also tried using only one process in CRON, blocked all others, it doesn't change a thing.

The server is SSH.

What can possibly lead to solving the issue?

Alexander Tolkachev
  • 4,513
  • 3
  • 14
  • 23
  • 1
    Does this answer your question? [Why is my crontab not working, and how can I troubleshoot it?](https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it) – Gerald Schneider Aug 05 '22 at 13:53
  • 2
    Remember that cron jobs run in a different environment (path, variables, maybe even shell) than command line jobs. – Barry Carter Aug 05 '22 at 14:02
  • Unfortunately, no. Cron works fine with other processes. This one is running also starts successfully, I coded in python to output logs to monitor where arw we. So we go to the half of the way, then the process kills, in different places always There is something more complicated – Nikita Tsekhanovich Aug 05 '22 at 14:03

0 Answers0