PyCon APAC 2023

ロケール設定が保存されました。pretalxでは英語のサポートが充実していると思っていますが、問題やエラーが発生した場合は、ぜひご連絡ください。

How much data can we cram into 16G RAM with less budget?
2023/10/28 , track 5

The amount of memory typically used can range from a minimum of 4G to a maximum of 64G or more. Some enterprises use even more memory than this, but in most cases, the amount of memory that can handle large volumes is limited by cost.
Let's explore different ways to approach the problem of processing large amounts of data in a constrained environment at the lowest cost using Python.


To maximize data handling within a 16GB memory constraint using Python while minimizing costs, consider the following strategies:

  • Sampling data and removing unused data: Working with representative data samples and discarding unnecessary data.

  • Chunks and iterators: Processing data in smaller chunks and utilizing iterators to work incrementally.

  • Memory-efficient data structures: Choosing data structures optimized for memory usage, such as numpy arrays or pandas dataframes.

  • Using the data compression parquet format: Compressing data using the parquet format to reduce memory footprint.

  • Parallelization: Leveraging parallel processing techniques to distribute the computational load across multiple cores or machines.

  • Using databases: Employing database systems like SQLite or PostgreSQL to store and query large datasets efficiently.

  • Distributed processing frameworks Dask, Spark, etc.: Utilizing frameworks like Dask or Spark for distributed processing and handling large-scale data.

Each approach has its own advantages and disadvantages in terms of performance, complexity, and setup. Learn how to choose a strategy that fits your specific use case, data characteristics, and available resources to make the most efficient use of limited memory while keeping costs low.

She has worked as a backend developer for gaming and advertising companies. She runs the TodayCode YouTube channel on data science. She is also a Microsoft MVP and loves to share and grow with the community. (https://www.youtube.com/todaycode)