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

139
Vistas
Java 17 stack size and actual memory consumption

Is there any real downside to allow for a VERY large stack on the JVM, like gigabytes?

In particular, with many threads, is this going to give troubles? if the stack space is not actually used, is there going to be more wasted memory in practice on the most used JVMs running on win/linux/mac?

For example, if I allocate 1GB for the stack, and I run 100 threads, but they do not actually fill up the stack space with actual data, would running the program require 100GB of actual physical memory?

This question is strongly connected with this old one (Dynamically expandable JVM stack) that was asked 10 years ago when the Java environment was quite different.

Now near every Java program runs over a 64 bits architecture, and so much in JVM has overall improved.

Expansion: I'm often running very complex recursive programs on large/deep data structures, and having to use free monads or other program transformations to use the heap instead of the stack is complex, slow and possibly pointless. An alternative would be using Java looms fibers, but.. again, may be just allocating a duper stack is easier and faster. I see why this is not done in C/C++, but under a VM this should be reasonable. Is it?

over 4 years ago · Santiago Trujillo
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