Skip to content

memory increase of 7mb(~) observed with the python-redis-4.5.5 #2860

Open
@chandramaradana

Description

@chandramaradana

Version: What redis-py and what redis version is the issue happening on?
redis-7.0.11 and python-redis-4.5.5 compared with
redis-6.2.12 and python-redis-3.5.3

Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure)
Python-3.9.16/openssl-1.1.1u
Custom Linux distro 4.19.284-pc64

Description: Description of your issue, stack traces from errors and code that reproduces the issue
As part of upgrading redis server to 7.0.11, to support backwards compatibility i have upgraded python-redis to 4.5.5 and observed that memory increase of 7mb(~) per import redis.

I have executed the following mentioned code snippet on python3 intrepreter and captured the top o/p.

python-redis : 3.5.3

Python 3.9.16 (main, Jun 19 2023, 17:55:44)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

def func1():
... print("this is en")
...
func1()
this is en

without import redis:
422 nik+ 20 0 10.6m 7.8m 0.0 0.1 0:00.03 S `- python

def func2():
... import redis
...
func2()

with import redis:
421 nik+ 20 0 18.7m 15.1m 0.0 0.1 0:00.12 S `- python

Above steps are repeated with python-redis 4.5.5 and following are the results:

without import redis:
415 nik+ 20 0 10.6m 8.1m 0.0 0.1 0:00.02 S `- python

with import redis:
415 nik+ 20 0 26.9m 23.3m 0.0 0.1 0:00.26 S `- python

Is this a expected behavior ?
If Yes, Is there any way i can reduce the memory footprint by disabling some feature set ( which are not related to security) introduced b/w the above releases during build time ?
Kindly could you provide any other alternative if any, to reduce the memory.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions