Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Swing application

Thread view: 
Igor Buzatovic - 13 Jan 2004 15:16 GMT
Hi, I have two questions about swing applications.

1. I have swing application (JFrame with complex content), if I minimize
jframe and don't use it for some time then I maximize the frame by clicking
it on windows taskbar the frame apears on screen but it takes long time
before it repaints (gray surface is all I see for aprox. 10 seconds). What
is the reason for that, and is there some workaround to solve this problem?

2. Does better graphic card installed on client computer ensures better
performance of Swing applications?
ak - 13 Jan 2004 16:58 GMT
> 1. I have swing application (JFrame with complex content), if I minimize
> jframe and don't use it for some time then I maximize the frame by clicking
> it on windows taskbar the frame apears on screen but it takes long time
> before it repaints (gray surface is all I see for aprox. 10 seconds). What
> is the reason for that, and is there some workaround to solve this problem?

your OS makes memory swapping at this time.

____________

http://reader.imagero.com the best java image reader.
Igor Buzatovic - 13 Jan 2004 17:19 GMT
>> 1. I have swing application (JFrame with complex content), if I
>> minimize jframe and don't use it for some time then I maximize the
[quoted text clipped - 4 lines]
>
> your OS makes memory swapping at this time.

so, if I cal gc frequently enough to make my memory garbage small, I would
teoreticly solve the problem?
David Postill - 13 Jan 2004 21:45 GMT
| >> 1. I have swing application (JFrame with complex content), if I
| >> minimize jframe and don't use it for some time then I maximize the
[quoted text clipped - 7 lines]
| so, if I cal gc frequently enough to make my memory garbage small, I would
| teoreticly solve the problem?

It's possible, depending on your version of windows and how your swap space
is configured, that the whole jvm could be swapped out and need reloading as
well as your application's class files...

You will have to do some testing/benchmarking to find out.

<davidp />

- --
David Postill
Steven T Abell - 14 Jan 2004 05:27 GMT
> so, if I cal gc frequently enough to make my memory garbage small, I would
> teoreticly solve the problem?

Invoking gc guarantees nothing.
The definition of gc basically says
that the VM can run gc if it bloody-well feels like it
when you invoke this method.
Generally, they don't.
Try adding more memory.

Steve
Igor Buzatovic - 14 Jan 2004 08:30 GMT
>> so, if I cal gc frequently enough to make my memory garbage small, I
>> would teoreticly solve the problem?
[quoted text clipped - 5 lines]
> Generally, they don't.
> Try adding more memory.

That sounds like Microsoft

Customer> I have problems with the performance of your application, please
help.
Misrosoft > Buy stronger machine

I have 768 mb RAM, isn't that enough
Antti S. Brax - 14 Jan 2004 09:13 GMT
buzz@vip.hr wrote in comp.lang.java.gui:

>>> so, if I cal gc frequently enough to make my memory garbage small, I
>>> would teoreticly solve the problem?
[quoted text clipped - 7 lines]
>
> That sounds like Microsoft

    No matter how tiny amount of memory your Java program uses
    it will get swapped to disk when unused if other programs
    require more memory than what you have. There is nothing
    Microsoft or anyone else can do to prevent it.

    But then I also have the impression that Microsoft's operating
    systems swap programs to disk when they have been unused even
    if there is no need for swapping. Maybe they want to free the
    memory so that the next program you need gets started quicker?
    Don't know for sure and don't care. Linux fills my needs better.

Signature

Antti S. Brax - asb(at)iki.fi   Rullalautailu pitää lapset poissa ladulta
  http://www.iki.fi/asb/          http://www.cs.helsinki.fi/u/abrax/hlb/

Steven T Abell - 14 Jan 2004 16:36 GMT
>>>so, if I cal gc frequently enough to make my memory garbage small, I
>>>would teoreticly solve the problem?
[quoted text clipped - 7 lines]
>
> That sounds like Microsoft

I'm sure it does, but invoking gc will still not solve your problem.

> I have 768 mb RAM, isn't that enough

I have a lot less than that.
Steve W. Jackson - 14 Jan 2004 17:23 GMT
>:>>>so, if I cal gc frequently enough to make my memory garbage small, I
>:>>>would teoreticly solve the problem?
[quoted text clipped - 13 lines]
>:
>:I have a lot less than that.

And all the memory in the universe won't solve your problem (if it's
memory related at all) unless your JVM has been given enough.  Java's
memory model isn't like other environments -- its heap has a min and max
size indepent of the underlying OS.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama

Igor Buzatovic - 15 Jan 2004 08:42 GMT
>>>>>> so, if I cal gc frequently enough to make my memory garbage
>>>>>> small, I would teoreticly solve the problem?
[quoted text clipped - 18 lines]
> memory model isn't like other environments -- its heap has a min and
> max size indepent of the underlying OS.

Yes, I know. That's why I thought that calling Runtime.gc() periodically
would keep memory heap low so when I maximize my frame even is gc() is
called at that time garbage collecting will not take long time.
Andrew Thompson - 15 Jan 2004 13:20 GMT
| ..That's why I thought that calling Runtime.gc() periodically
| would keep memory heap low so when I maximize my frame even is gc() is
| called at that time garbage collecting will not take long time.

The best way to ensure that memory can
be gc'd is to ensure that there are no references
remaining to objects you have finished using.

LargeObject lo = new LargeObject();
//....  do stuff
lo = null;

HTH

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.