FAQ  •  Register  •  Login

My binary occupies the same reducing the HEAP

<<

jevilon

Posts: 4

Joined: Wed Feb 06, 2013 8:44 pm

Post Wed Feb 06, 2013 8:48 pm

My binary occupies the same reducing the HEAP

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?
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sun Feb 10, 2013 8:48 pm

Re: My binary occupies the same reducing the HEAP

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á.
<<

jevilon

Posts: 4

Joined: Wed Feb 06, 2013 8:44 pm

Post Sun Feb 10, 2013 10:36 pm

Re: My binary occupies the same reducing the HEAP

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
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Sun Feb 10, 2013 11:00 pm

Re: My binary occupies the same reducing the HEAP

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 :)
<<

jevilon

Posts: 4

Joined: Wed Feb 06, 2013 8:44 pm

Post Sun Feb 10, 2013 11:11 pm

Re: My binary occupies the same reducing the HEAP

of course, but we are investigating the issue is not me, is na_th_an and knows a lot more on this topic ...
<<

ref

Posts: 3

Joined: Sun Jul 18, 2010 10:43 am

Post Sat Dec 19, 2015 4:06 pm

Re: My binary occupies the same reducing the HEAP

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 :) Please remind me if I ask nonsense questions.

Thank you

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO