Let's Swing!
A globally warmed, Swing focused blog in the Participation Age.
I've definitely moved this blog to my personal site!

Liberte, Fraternite, Egalite?

viernes octubre 22, 2004 | Sun | Permalink |

Liberté, Fraternité, Egalité???

So I wonder what Microsoft is thinking about... The should join Liberty now: that'd be safer for their customers, right?

Customers? Well, maybe Microsoft's customers are not in charge after all...

NetBeans4.0B2 GC revisited: lots of fun

martes octubre 19, 2004 | General | Permalink |

So I have been playing around with NetBeans 4.0B2. Quite impressive, effective, fast, right-to-the point IDE. I am just missing a VI key binding ;-)

I wanted to share with everybody my findings just in case you want to consider using them.

Garbage Collection Tuning

I didn't like the default [NETBEANS]/etc/netbeans.conf so I commented out the line starting with "netbeans_default_options" and I used another one:

netbeans_default_options = -J-XX:MaxGCPauseMillis=100 
  -J-XX:GCTimeRatio=99 -J-Xms48m -J-XX:PermSize=32m 
	-J-Dcom.sun.management.jmxremote

(Note that this is just a single line).

Garbage Collection Ergonomics: comfortable ;-)

The MaxGCPauseMillis and GCTimeRatio are new in JDK5.0. This is known as Garbage Collection Ergonomics and is used to avoid having to tune the GC yourself.

Quite comfortable. The fact is that I am surprised it does a very good job at tuning the GC. Little human intervention needed ;-)

PermSize

NetBeans 4.0B2 uses quite a bit of memory for class information. This memory is stored in the "Permanent Generation" space, so I just gave it around 32m. This avoids lots of full generations (specially at startup) and gives NetBeans some more life.

Management: Cooool

Now this is cool. If I set the "-Dcom.sun.management.jmxremote" on the command line I can monitor the JVM using the "jconsole" tool. I just write "jconsole" and the full thing starts playing.

Of course this is a time consunming thing: having to monitor the JVM all the time, but it is interesting because I can see how memory consumption evolves and what each thread is doing. Looking at this I've found that NetBeans guys are smart enough to use BlockingQueues for inter-threading communication. That's a best practice I'll be talking around soon, that avoids for instance having to use all those SwingWorkers all the time. Keep tuned for that. Have fun meanwhile.

Collections Trick I: LRU Cache

martes octubre 12, 2004 | General | Permalink |

Maybe it's just my job. Or maybe it's just fashion. The fact is that I meet little people understanding and/or taking advantage of Data Structures and Algorithms. People tend to use higher-level abstractions (EJBs, JSPs and the like) and usually forget about the low-level stuff.

I don't mean you have to be an expert on that, but I think it's indeed useful.

So the other day, talking to a customer, I noticed he was trying to build a LRU (least recently used) cache for whatever it was. And he was in trouble. He didn't know that's already done, and it's well done.

The fact is that he didn't pay attention to the LinkedHashMap. You do it as follows:


LinkedHashMap lruCache = new LinkedHashMap( 10, 0.75f, true )
 {
    protected boolean removeEldestEntry( java.util.Map.Entry entry )
      {
        return size() > 100;
      }
 };

So I think it's a good idea to post these tricks from time to time, so everybody can take advantage of them.

Have a good hacking!

Kenny won't let them die

viernes octubre 08, 2004 | Sun | Permalink |

So you are writing a Word document in Microsoft Windows and the system just hangs.

And you forgot to save your work so you're in trouble. Big trouble.

And you restart your box and start all over again. And you think of Gates.

You don't understand why the system hangs. It just happens. You either reboot or reinstall. No options left.

Now imagine that happens with the computers of your bank. The computers holding your money. Or the computers handling a nuclear plant. Or the computers making people travel to Mars.

Here at Sun we have Kenny Gross. Impressive guy. Impressive team. Go see how Kenny uses maths to early detect failing parts of servers. Wow. Isn't that cool?.

I'll be posting on J2SE5.0 and NetBeans 4.0 Beta2 by next week. Keep tuned. Have a good weekend.


Categories


Search


Recent entries


Sites I find interesing

Aggregators
Swing focused
Software architecture related @ blogs.sun.com

Calendar

« octubre 2004 »
lunmarmiéjueviesábdom
    
1
2
3
4
5
6
7
9
10
11
13
14
15
16
17
18
20
21
23
24
25
26
27
28
29
30
31
       
Hoy

Navigation


Visits

Locations of visitors to this page