-2

I'm having issues in K8s with memory allocation. Pod gets killed by OMM Killer, because of strictly defined limits, let's say 1GB.

How python 3.7 (python memory manager) allocates memory? From the pod memory graph I can assume that it allocates double amount of memory for heap.

trincot
  • 317,000
  • 35
  • 244
  • 286

1 Answers1

0

Linux:

You can limit the used resources from inside your program - not sure if it helps you though:

  • resources.setrlimit

    Sets new limits of consumption of resource. The limits argument must be a tuple (soft, hard) of two integers describing the new limits. A value of RLIM_INFINITY can be used to request a limit that is unlimited.

For windows this might help: Limit python script RAM usage in Windows

Edit: Post for limiting under linux: Limit RAM usage to python program

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69