Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My binary occupies the same reducing the HEAP
#2
jevilon Wrote:First, apologize if this topic has been discussed, but I do not speak good English and I can not find either.

My "problem" is that although HEAP reduce to 512, the binary I still occupies the same is not supposed to reduce the size and leaves you more space for the program?
The binary will always occupy the same length. The heap is used past the binary code and is not bundled with the it. When the program starts, it knows how long the heap is, and won't take more memory (mainly to avoid destroying other data, like graphics).

Usually you don't need to reduce the heap, unless your program does not fit into memory as is.

jevilon Wrote:Lo primero, pedir disculpas si este tema se ha tratado, pero no hablo bien ingles y no puedo buscar bien.

Mi "Problema" es que aunque reduzca el HEAP a 512, el binario me sigue ocupando lo mismo ¿no se supone que reduce el tamaño y te deja mas espacio para el programa?
El binario siempre ocupará lo mismo. El heap se usa justo después del código binario, y no se "empaqueta" con el mismo. Cuando el programa se ejecuta, sabe cuánto mide el heap y no tomará más memoria (principalmente para evitar destruir otros datos, como los gráficos que pudiera haber después).

Normalmente no tiene sentido que acortes el heap salvo que tu programa no quepa en memoria tal cual está.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)