Improving performance of Eclipse/FlexBuilder

May 13th, 2008 . by polygeek

I’m working on a Flex project that is just kicking Eclipse in the ass. It takes forever to build and I keep getting out of memory errors. Finally, I complained about the issue on Twitter and @tomcornilliac was nice enough to twit back that I needed to give Eclipse a bigger heap by editing the eclipse.ini file.

Simple enough. My eclipse.ini file is in the root folder of the Eclipse installation and looks like this:

-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx256m

-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv4Stack=true

I changed the two bolded lines to:

-Xms256m
-Xmx512m

And everything runs much faster and I haven’t gotten any of those pesky errors since.

You can also go Window > Preferences > General > Show heap status to get a display of how much RAM Eclipse has to work with and how much it’s actually using. Very handy to turn that on to see if you need to increase your RAM allowance.

Here’s a link to a few other suggested performance improvements you can do to Eclipse/FlexBuilder.


Publishing Flex projects with Flash keyboard shortcuts

March 10th, 2008 . by polyGeek

I can’t believe I didn’t think of this earlier. It’s simple to change the keyboard shortcuts in FlexBuilder so I changed the “Run” keyboard shortcut from Shift + F11 to Ctrl +Numpad_Enter. That’s what I was used to in the Flash IDE. And I changed Debug to Ctrl + Enter. It’s a small change but makes FlexBuilder seem a little more familiar.

Go: Window -> Preferences… Expand  General and select Keys. Then just  scroll down to Run. ( To get there faster type run into the “type filter text” field and then scroll. )

FlexBuilder keyboard shortcuts

And it’s not a bad idea to scroll through the, rather long, list of actions that can have keyboard shortcuts. There’s a bunch of things in there I didn’t even know FlexBuilder could do.


Error (#2148) Loading XML with Flex2

January 11th, 2007 . by polyGeek

I was running through a simple tutorial for loading XML into Flex and displaying it in a DataGrid when I got the following error:

[RPC Fault faultString=”Error #2148: SWF file file:///C:/Documents and Settings/…/My Documents/xmlParsing/bin/xmlParsing.swf cannot access local resource Blades.xml. Only local-with-filesystem and trusted local SWF files may access local resources.” faultCode=”InvokeFailed” faultDetail=”null”]

If I go into the bin folder and launch the SWF directly then everything loads and works correctly. That right off is a tip that it’s probably a security issue. Sure enough. With a little research I found it.

  • In the Navigator panel Right-click and select Properties
  • In the lefNav select Flex Compiler
  • In the Additional compiler arguments: field add the following argument: -use-network=false

So my arguments read: -locale en_US -use-network=false

It would seem that this setting has to be made for each project.

Stupid security settings. :-)

When I Googled this problem I only got three hits back. My guess is that this will be a common problem so it wouldn’t hurt for others to duplicate this solution to make it easier for others to find.

Aside: I had to create the Flex category to for this post. Nice to start things off with a fraking error.