+ 1

Facing ram and lagging issues in Python

After loading multiple dataframes in python facing ram and lagging issues.

8th Dec 2022, 2:59 AM
S S
5 Answers
+ 6
It sounds like you are running into memory issues because you are loading multiple dataframes into memory at the same time. This can cause your program to run slowly or even crash if you run out of memory. One way to address this issue is to only load the dataframes that you need at any given time, and unload the dataframes that you are not using. You can use the del keyword to remove dataframes from memory, like this: del df1 del df2 Another approach is to use a database to store your data, instead of loading it all into memory at once. This way, you can query the database for the specific data that you need, and only load that data into memory. This can help reduce the amount of memory that your program uses, and can improve its performance
9th Dec 2022, 12:19 PM
Sadaam Linux
Sadaam Linux - avatar
+ 6
You can also try using a 64-bit version of Python, which can access more memory than a 32-bit version. This can help if you are running into memory limits with a 32-bit version of Python. Finally, you can try using tools like pandas to optimize the memory usage of your dataframes. pandas has options for reducing the memory usage of dataframes, and these can sometimes help if you are running into memory issues. Hope it helps.
9th Dec 2022, 12:20 PM
Sadaam Linux
Sadaam Linux - avatar
+ 1
I'm not sure what you want from the forum users? You can share your code and see if there's someone who might identify the problem. Maybe a memory leak...? Other than that... you might need a better machine with more RAM.đŸ€·â€â™‚ïž
8th Dec 2022, 9:39 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
https://docs.python.org/3/c-api/memory.html This seems like it might help.
8th Dec 2022, 1:41 PM
Ausgrindtube
Ausgrindtube - avatar
0
Ausgrindtube This is regarding pandas DataFrame. I was trying to explore the data for ML algorithm. But l am facing lagging issues after creating multiple dataframes. I want to know, is there any method for memory management in python?
8th Dec 2022, 10:28 AM
S S