Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
Streamed ZIP file download from Rails on Heroku causes increasing memory usage

I'm using zipline to generate and stream a ZIP file as a browser download. The ZIP generation and downloading happen simultaneously. Everything functions as expected but Heroku seems to use increasingly large amounts of memory as files are downloaded. The increase in memory consumption is generally close to, but not as large in size as the zip file being downloaded. The ZIP is compressed but the contents are highly compressed already so I don't think this difference is due to that. Consistently triggering a re-download of the same ZIP does repeatedly increase memory usage, but it does seem to trail off.

There is no passive memory leak, but at least as far as Heroku is reporting, it's clear that something about this process requests more memory and doesn't seem to ever release it to the OS (?).

Last 24 hours:

last 24 hours memory usage

Last 2 hours:

last 2 hours memory usage

Ruby metrics as reported by Heroku:

heroku ruby memory metrics

Virtually every sharp increase in the memory usage graphs is a ZIP download being triggered. I changed to a dyno with 1GB memory instead of 512MB to see if it would help or release memory but it did not.

Ruby free memory slots and heap objects do not seem to change at all. I don't know if this is a flaw in the beta metrics plugin on Heroku but I don't know how to investigate that.

The zipline gem uses ZipTricks as a back-end, and I've re-implemented what I already had done with ZipTricks directly and found the exact same problem.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

https://github.com/schneems/puma_worker_killer Why don't you try this? Memory fragmentation seems to progress even when memory release is performed.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda