> > > > I have a simple large window, it contains nothing, only display
> > black,
> > > > but it will consumes lots of memory (totally w * h * 4 Bytes), ps:
> > my
> > > > platform is 32bpp.
> > > > =3D
> > >
> > > > Why such a simple window consume so much memory? How to reduce the
> > > > memory consume. Thanks.
> > >
> > > How much memory would you expect it to consume?
> > =
>
> > I expected it consume not more than 1MB, and it should not related to
> > window size, maybe it is a stupid thinking.
>
> The "system" needs to represent the whole window somewhere, at least
> once (a double buffered window will need at lest two instances...) and
> if the GPU and CPU use the same RAM... =
>
> Then it depends on how the GPU and its driver represent the window data
> in RAM, of course, but the "simplest" (and often fastest) thing to do is
> simply to represent each pixel directly in RAM.
> So, a 640x480 window with 32bpp would need about 1MB, double-buffered
> would double that up...
>
> Note that this is not really a fltk question - we only use the
> underlying windowing system, we don't control how the memory is
> allocated to the window.
>
>
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 3EL
> A company registered in England & Wales.  Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>

I know if has image in this window, it will allocate double w*h bytes memory, 
but my question is why new a empty window will also allocate w*h bytes memory? 
In fltk1.3, will has no such case.

My code is as follows:

#include <fltk/Window.h>
#include <fltk/run.h>

using namespace fltk;

int main()
{
    Window *w = new Window(0, 0, 1280, 800);
    w->color(WHITE);
    w->show();
    return run();
}

my OS is linux, compiler is arm-linux-g++.
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to