Thursday, December 23, 2004

Performance Tip: Make More Memory Available!

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I've seen a couple of customer projects today (thanks for sending those in!), and one thing became obvious: we've set the default maximum heap size for the Java VM too small. It's currently set to 128 Mb; but with the IDE running, lots of data sources, a dozen pages with lots of components on them etc. two of the projects were up in the 120 Mb range when all the pages are open at the same time.



So you should increase the amount of memory you make available to the IDE. This will not only make the IDE run faster (because when the IDE is getting near the memory limit it does a lot more garbage collection), but it will avoid OutOfMemory exceptions and other problems that occur if you actually get up to the limit.



To change the memory limit, do this: locate your IDE installation, and edit bin/ide.cfg with a text editor. It currently looks like this:


-J-Xms24m -J-Xmx128m
-J-Xverify:none
...

Change this into

-J-Xms24m -J-Xmx256m
-J-Xverify:none
...

and restart the IDE.



It's possible some of the Patch 5 symptoms showed up for some of you whose project memory requirements were near the limit, simply because with the extra preview features and other fixes, the IDE is taking up more of the available heap space and you run out of memory.


Creator patch 5 problems

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


So I mentioned yesterday that patch 5, also known as "Reef", is shipping.
Some users on the Creator forum have
reported seeing problems with the latest patch. We've dropped everything else
and spent the day studying the problem and have some preliminary ideas
about what the problem is. Hopefully the following explanation can help
those of you who are affected by this.



By the way, my coworker Eric has
started blogging. This issue
is in his area of expertise so I'm sure he'll have more to say, but at
the moment he's busy thinking of the best way to fix this problem!



Until patch 5, there were some scenarios where you could have errors in your
application, and the Creator source modeller wouldn't realize it. This could
lead to some bad results, like your code getting munged. These holes were
closed in patch 5. However, it's not handling the case where you try to
open a "bad" project from disk. If you've been using patch 4 you may not realize
there are problems in your application, since the source modeller wasn't
identifying this problem; you just ran the risk of Bad Stuff(tm) happening.
(Also, there's one change in patch 5 which could cause your project to no
longer be valid (the getContext() issue; see below.)



Now this problem is detected at startup, but it's not handled well so what ends
up happening is that you load your application, various pages are marked as
having errors, and these pages get parsed over and over again (explaining the
CPU spiking two people reported) and consuming a lot more memory than was
required before (explaining some OutOfMemory exceptions another user was
reporting).



So, until we put out a fix for this, if you want an immediate solution,
you need to go edit your project (on disk) to remove the problem, then
you can open it in patch 5 and everything should be fine (and better/safer than
in patch 4; it will now alert you immediately when you do something to
put the project into a bad state.)



The problem is that it's not easy to find out what's wrong about your project.
That's probably what the user visible change of the fix will be: project errors
that blocks the source modeller on project open will be listed immediately so
you can handle them there and then. In the meantime, Eric has
identified a process you can use
to get your project back into shape.



However, before you try that: There's one more potential problem which could explain why your pages are
suddenly not understood by the source modeller: the getContext()
method in your page beans' superclass is missing in patch 5. So if any of
your page beans are using this method,
change the method call to getFacesContext() or add a method
named getContext which calls getFacesContext().



Also, if you have large projects (as some of you do) you may want to bump
up the memory assigned to Creator; edit Creator-location
/bin/ide.cfg and replace -J-Xmx128m on the
first line with -J-Xmx256m .


Wednesday, December 22, 2004

Creator update available

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


update
Creator Patch 5 is now available. Go hit the Update Center!



There are a number of new features and preview features to look for --
here's the list. Plus of course
lots of bug fixes.




Monday, December 20, 2004

Do you need Internet Explorer support?

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I recently went over the designer code in Creator and checked how much of
the CSS 2.1 spec it covers.
It intentionally doesn't address properties
that are nonvisual (such as the audio ones), or the ones for paged media
(not a priority for web apps), or properties that are interactive in
nature, such as cursor - these are not appropriate for
design time rendering. (The cursor for example is already is used to
indicate designer state, like whether the component under the cursor is resizable.)



With the above removals, the list of missing properties is pretty short.
(In fact, the list got much shorter when I updated from CSS 2 to CSS 2.1, since
CSS2.1

removed a number of properties and property values I was not supporting. Now I
no longer need to implement
cjk-ideographic | hiragana | katakana | hiragana-iroha | katakana-iroha for list-style-type to be compliant, for example.



There is however another set of properties I haven't implemented:


  • max-height, min-height, max-width, min-width
  • content, quotes, counter-increment, counter-reset
  • empty-cells
  • background-attachment (apparently implemented in IE but incorrectly)


What's special about these, and why aren't they implemented?
I didn't prioritize them because Internet Explorer
does not support them. Therefore, many users probably don't want to rely
on them given IE's still dominant market share.




So, today I have a question in my blog: If you develop a webapp using Creator,
do you limit yourself to CSS properties supported by IE? Or can you assume
that your users will use a standards compliant browser like
Firefox,
Safari or
Opera?
And if IE support is important, do you need any of the above CSS properties
in particular? Finally, I know there were some rumors/discussions a little while
ago about IE development having been resumed; is there any truth to that,
and have they said anything about plans for full CSS support?



By the way, on Friday I implemented the last five missing properties on
my list (other than the above IE-missing properties):
visibility (clip
was already implemented), font-variant,
text-transform, text-indent, and
font-family search lists. Now I've gotta
go and make sure all the property values are supported for these properties
too.


Thursday, December 16, 2004

iPod to the Rescue!

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.



I just saw this on
webstandards: You can

install the CSS 2.1 spec

on your ipod! Good for offline reading while stuck in line at DMV or elsewhere...



I recently argued
why learning CSS is going to be worth your while when working with Creator and JavaServer Faces in general.



I was just about to install it when I realized I don't really need to; in implementing the designer
I've actually memorized most of the spec! It's the first item in my
Firefox bookmarks list.




Monday, December 13, 2004

The Big Day

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.





Tomorrow (Tuesday) is the big day; my youngest son is having
major surgery. It's been planned for a couple of months, so
it will be great to get it over with, but I will be a nervous
wreck for five hours tomorrow.



Keep your fingers crossed!



I'll be back online in a couple of days.




UPDATE 14. Dec 2004, 9:30 PM PDT: It's over, and the surgery was a success! He is recovering nicely. Thanks for your support everybody!




Saturday, December 11, 2004

New Creator blogger

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


Another developer in the Creator group, Edwin Goei, has
started blogging.


Friday, December 10, 2004

Forum Solutions

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I just caught up on the threads in the
Creator forum
and came across some good stuff. Jonathan of
Solutions In A Box who has been an active
participant in the forums has posted solutions for how to
provide file uploads
(something several forum users have asked how to do, since JSF doesn't ship with a component
for this), and
how to include Jasper
reports
.



There have probably been some other good solutions posted in the past too that I've missed, so point them out and I'll link to them here.


Wednesday, December 8, 2004

Code Clips

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


There's a new review of Creator on developer.com written by Dick Wall. A nice write-up.



One minor note:


"Adding a new clip is as simple as putting some code into the copy/paste buffer, then choosing a menu option to add it to the clips using a given name."

Actually, it's as simple as selecting the text in the editor, and dragging it and dropping it on the palette! I've seen a lot of comments on Creator that mention the code clips -- I guess it really addresses a need.



There's a cool, but hidden feature related to code clips: if you surround some text in the code clip with "@", it will be become a parameterized code clip. When you drop the code clip, you get a dialog asking you to submit the values for these parameters.

For example, you might have some code like this in the editor for doing a bundle lookup:


NbBundle.getMessage(this.getClass(), "MyKey")


If you change this into

NbBundle.getMessage(this.getClass(), "@key@")


and drag this on the palette, then the next time you drop the clip you get this dialog:





If you enter say the text "Hello" into the value field and hit OK, the text inserted in the editor
at the clip drop point is:

NbBundle.getMessage(this.getClass(), "Hello")



Unfortunately, there's a bug (fixed in the next patch) which prevents this code from working
correctly with code clips where the parameters are repeated in the code (such as the iterator variable in a for loop), but the fix for that should be available soon.


Thursday, December 2, 2004

More Rendering Work

WARNING: This blog entry was imported from my old blog on blogs.sun.com (which used different blogging software), so formatting and links may not be correct.


I spent some more time on the XHTML/CSS layout engine in the designer.
One area I was mistreating badly was floating boxes, especially inside
tables - and this comes up more often than you'd think because the
align=left|right attribute in HTML is implemented using floating
boxes. I've fixed that now and as a result some more page tests
are looking better, as you can see in the screenshots below.



The Apple page still isn't looking good because I haven't implemented
the deprecated <center> tag and it looks like they're relying
on it, just like Google does, to center block formatted tags. Sigh.
I was thinking I could simulate it with CSS margin: 0 auto,
but unfortunately margins don't inherit by default so a simple alias won't
work.














screenshot



screenshot



screenshot



screenshot