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
  negative memory usage akbarza 1 108 Yesterday, 08:43 AM
Last Post: Gribouillis
  class and runtime akbarza 4 400 Mar-16-2024, 01:32 PM
Last Post: deanhystad
  painfully slow runtime when handling data dadazhu 3 980 Jan-20-2023, 07:11 PM
Last Post: snippsat
  Big O runtime nested for loop and append yarinsh 4 1,397 Dec-31-2022, 11:50 PM
Last Post: stevendaprano
  [CPython] Can't run script python VietVH 2 1,217 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 1,242 Apr-28-2022, 07:13 AM
Last Post: Anldra12
  Navigating cpython source using python quazirfan 3 2,040 Aug-09-2021, 07:52 PM
Last Post: quazirfan
  Reducing JSON character count in Python for a Twitter Bot johnmitchell85 2 54,065 Apr-28-2021, 06:08 PM
Last Post: johnmitchell85
  IronPython from CPython amasis 3 2,224 Feb-05-2021, 12:26 PM
Last Post: jefsummers
  ImportError: /home/pybind11_example.cpython-37m-x86_64-linux-gnu.so: undefined symbol chaitra 2 5,132 Feb-03-2021, 05:14 AM
Last Post: chaitra

Forum Jump:

User Panel Messages

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