Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My binary occupies the same reducing the HEAP
#1
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?


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?
Reply
#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
#3
ok, the problem is that the binary weighs 28 ks and I still have a lot of things to do, but na_th_an helping me pass at 128 k. Thanks for answering the question

ok, el problema es que el binario pesa 28 ks y aun me quedan un monton de cosas por hacer, pero na_th_an me esta ayudando a pasarlo a 128 k. gracias por responderme a la duda
Reply
#4
jevilon Wrote:ok, the problem is that the binary weighs 28 ks and I still have a lot of things to do, but na_th_an helping me pass at 128 k. Thanks for answering the question

ok, el problema es que el binario pesa 28 ks y aun me quedan un monton de cosas por hacer, pero na_th_an me esta ayudando a pasarlo a 128 k. gracias por responderme a la duda
Ok. Please, if you like, share with us the technical solution you did to pass it to 128K Smile
Reply
#5
of course, but we are investigating the issue is not me, is na_th_an and knows a lot more on this topic ...
Reply
#6
Resurrecting this old thread, because I am having trouble understanding how compiled code uses the heap space.

1. As I check the memory image of my compiled and running program, heap is used and it's full of strings and other data, and currently it's in default size of 4.7kb. What if I reduce the heap to say, 2kb. What will happen to the strings that occupy heap space? How can I determine how much of heap space is used and effectively limit heap_size?

2. I am very close to filling 48kb ram, only about 700bytes left, I need about 1kb more. I added my post at the end of this thread because I might need to use 128k paging to enhance my game further. I was planning to split programs into different parts as compiled output currently 18kb, and with heap, it's 23kb. As its bigger than 16kb it's not easy to flip a page without reducing executable to under 16kb.

3. if I split my code to 2 different projects and compile them separately, how can I control stack pointer and heap so both programs run safely? And what's the best method of calling compiled boriel's basic code from different ram banks/pages? How should I construct standalone functions to be called from other part of compiled code?

I am very saturated with basic code nowadays and I am a little bit confused Smile Please remind me if I ask nonsense questions.

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)