Board index » kylix » Retorical question

Retorical question


2005-01-14 10:38:25 PM
kylix1
Hello,
Is it possible to develop big application on clx? To have created 100 forms
at one time? Does anyone ever made big stable applications on clx?
 
 

Re:Retorical question

Quote
Is it possible to develop big application on clx? To have created 100 forms
at one time? Does anyone ever made big stable applications on clx?
Normally you want to create forms when they are needed and destroy them when
they are closed. This prevents too many resources from being used.
In the Project|Options|Forms leave your main form set to Auto-create, but can
you set all or most of the other forms to "Available Forms"? Then you create
them as they are needed. Here is an example of creating a modal form that is
needed to change some settings and then destroyed when it closes:
with TMySettingsForm.Create(nil) do begin
ShowModal;
Free;
end;
These discuss Windows, but the principals apply:
groups-beta.google.com/group/borland.public.delphi.deployment/msg/9dec9d08c26e92a1
groups-beta.google.com/group/comp.lang.pascal.delphi.misc/browse_frm/thread/d1f7da929c553211/07fa29cef06d2640&&d#07fa29cef06d2640
Regards,
Wayne Sherman
Las Vegas
 

Re:Retorical question

"Wayne Sherman" <body1233 at yahoo dot com>wrote:
Quote
them as they are needed. Here is an example of creating a modal form that
is needed to change some settings and then destroyed when it closes:
I understand this. I asked this question because I have big project that
should be crossplatform. Several days ago I posted message in
borland.public.kylix.clx.components.using and had no reply. So I decided to
to try this conference.
I am getting exceptions class EInvalidGraphicOperation with message 'Invalid
canvas state request' after I create more when ~70 forms it doesn't matter
if it is just created or created and destroyed. Does anyone had created big
crossplatform application with clx? Did they had this problem on windows or
it is just me who has it. Please read my message in
borland.public.kylix.clx.components.using.
 

{smallsort}

Re:Retorical question

Jon < XXXX@XXXXX.COM >wrote:
Quote
"Wayne Sherman" <body1233 at yahoo dot com>wrote:

>them as they are needed. Here is an example of creating a modal form that
>is needed to change some settings and then destroyed when it closes:

I understand this. I asked this question because I have big project that
should be crossplatform. Several days ago I posted message in
borland.public.kylix.clx.components.using and had no reply. So I decided to
to try this conference.

I am getting exceptions class EInvalidGraphicOperation with message 'Invalid
canvas state request' after I create more when ~70 forms it doesn't matter
if it is just created or created and destroyed. Does anyone had created big
crossplatform application with clx? Did they had this problem on windows or
it is just me who has it. Please read my message in
borland.public.kylix.clx.components.using.
My application currently has 43 forms. Most are pretty simple modal
forms. I have not had the problem you describe.
 

Re:Retorical question

rbwinston wrote:
Quote
My application currently has 43 forms. Most are pretty simple modal
forms. I have not had the problem you describe.
Do you have it on Windows? If you can please try to create 100 instances of
one form with DBNavigator (with navigator is the fastest way to reproduce,
but can be anything elese, but need to create more instances). Maybe it is
just me getting that exception...
 

Re:Retorical question

Jon wrote:
Quote
Do you have it on Windows? If you can please try to create 100 instances
of one form with DBNavigator (with navigator is the fastest way to
reproduce, but can be anything elese, but need to create more
instances). Maybe it is just me getting that exception...
It is a GDI-Handle leak. I get exactly 10000 GDI Handles and then the
QBitmap_create generates empty bitmaps. But where is the leak. Is it in
CLX (not destroying a bitmap or something else) or is it in Qt itself.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Retorical question

Andreas Hausladen wrote:
Quote
It is a GDI-Handle leak. I get exactly 10000 GDI Handles
The same VCL application requires only around 870 GDI-Objects. Looks like
a very large leak.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Retorical question

Andreas Hausladen wrote:
Quote
Andreas Hausladen wrote:

>It is a GDI-Handle leak. I get exactly 10000 GDI Handles

The same VCL application requires only around 870 GDI-Objects. Looks like
a very large leak.
The problem is that each TSpeedButton has its own TImageList (aka
TGlyphList). Makes 10 SpeedButtons * 100 = 1000 image lists. And a image
list has more than 1 GDI bitmap.
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Retorical question

I do have it on windows but I don't use DBNavigator so I'm not going
to try your experiment. I see Andreas has also responded so you
should probably see if his comments help.
Jon < XXXX@XXXXX.COM >wrote:
Quote
rbwinston wrote:

>My application currently has 43 forms. Most are pretty simple modal
>forms. I have not had the problem you describe.

Do you have it on Windows? If you can please try to create 100 instances of
one form with DBNavigator (with navigator is the fastest way to reproduce,
but can be anything elese, but need to create more instances). Maybe it is
just me getting that exception...
 

Re:Retorical question

Andreas Hausladen wrote:
Quote
>The same VCL application requires only around 870 GDI-Objects. Looks like
>a very large leak.
Strange, I tried my experiment with vcl everything seams working fine...
even on Linux I had no problem with it.
Quote
The problem is that each TSpeedButton has its own TImageList (aka
TGlyphList). Makes 10 SpeedButtons * 100 = 1000 image lists. And a image
list has more than 1 GDI bitmap.
Is it possible to fix? Maybe there are workaround?
But anyway it is very strange thing that I do not understand. If I just
create and do not destroy there should be no memory leak. Memory leak
appears when destroyed object stays partly undestroyed, am I wrong?
 

Re:Retorical question

So, if I make my own speedbutton without graphics (or get one), it would be
safe.
Nice information, thanks.
 

Re:Retorical question

Buch wrote:
Quote
So, if I make my own speedbutton without graphics (or get one), it would
be safe.
As long as you do not keep every pixmap (Windows Bitmap) in a list. :-)
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

Re:Retorical question

Jon wrote:
Quote
Is it possible to fix? Maybe there are workaround?
Not without an interface change or a memory leak.
--
Regards,
Andreas Hausladen
 

Re:Retorical question

Andreas Hausladen wrote:
Quote
The problem is that each TSpeedButton has its own TImageList (aka
TGlyphList). Makes 10 SpeedButtons * 100 = 1000 image lists. And a image
list has more than 1 GDI bitmap.
Is it possible to find out how many bitmaps were created in my application
at runtime? To warn user that crash is coming :)