Python Forum
Reducing runtime memory usage in Cpython interpreter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reducing runtime memory usage in Cpython interpreter
#1
I'm running python on an embedded Linux system with a limited amount of main memory.

Is there any techniques that I can use to reduce system memory used by Cpython.
I'm presently using Python 2.7, but will be transiting to Python 3.8.

In top I see:
VIRT RES SHR
6.1m 3.8m 2.2m

for the trivial script:

import time

while True:
time.sleep(1)


The actual scripts that I run are taking about 30MB.

Any suggestions would be appreciated.
Reply
#2
python 2.7 has been obsolete since Jan 1, 2020
Load 3.10 (current version) and see if problems persist, if so ask again.
Reply
#3
(Oct-18-2021, 09:47 PM)Larz60+ Wrote: python 2.7 has been obsolete since Jan 1, 2020
Load 3.10 (current version) and see if problems persist, if so ask again.
This not a helpful response. I know the statuses. I cannot change the version of the interpreter.
Please be helpful.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting an error while trying to process data, low memory when memory is not low? bkeith12 0 1,221 Dec-20-2024, 03:06 PM
Last Post: bkeith12
  Extract args=, value that was passed to Multiprocessing.Proc object during runtime? haihal 1 1,117 Dec-08-2024, 07:04 AM
Last Post: Gribouillis
  change dataclass to frozen at runtime jpanico 2 2,434 Oct-06-2024, 09:38 AM
Last Post: snippsat
  negative memory usage akbarza 1 1,923 Apr-27-2024, 08:43 AM
Last Post: Gribouillis
  class and runtime akbarza 4 2,450 Mar-16-2024, 01:32 PM
Last Post: deanhystad
  painfully slow runtime when handling data dadazhu 3 2,821 Jan-20-2023, 07:11 PM
Last Post: snippsat
  Big O runtime nested for loop and append yarinsh 4 3,998 Dec-31-2022, 11:50 PM
Last Post: stevendaprano
  [CPython] Can't run script python VietVH 2 2,737 May-21-2022, 04:49 PM
Last Post: VietVH
  ImportError: /home/ali/Documents/test/charm/core/crypto/AES.cpython-39-x86_64-linux-g Anldra12 0 2,241 Apr-28-2022, 07:13 AM
Last Post: Anldra12
  Navigating cpython source using python quazirfan 3 3,662 Aug-09-2021, 07:52 PM
Last Post: quazirfan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020