I'm working on a small GWT project in Intellij using their built-in support. Dev mode functions, but the performance is really spotty, and I can only reload the app a handful of times before getting OutOfMemoryError (using -Xmx512M).
What should I be able to expect out of dev mode? Do others experience consistent reload times and long running processes?
I'm running GWT 2.2 with IDEA 10.0.3. My app is small, but I do include several other modules like Activity, Place, Resources, Guava Collect + Base, UiBinder, Gin Inject, etc. I believe the performance problems started before many of these dependencies were added, though.
Thanks!
You can try to increase PermGen memory size via: -XX:MaxPermSize=256m. It should help. I had the same problem, analyzed what's becoming exhausted with Visual VM and it turned out that PermGen was the problem. Of course -Xmx also helps.
Related
I was wondering if there is an 'easy' way to see what the memory footprint is, used by the objects created by JSF. For instance, I have some #SessionScoped objects and some #ViewScoped objects when going to a certain page.
I would like to know how much KB (or MB) they are using. This way, we can make an estimated calculation of the memory footprint per user of JSF.
I am using Eclipse and EAP 7 together with JSF 2.3. I tried using jvisualvm but no specific class information and size in memory is available. I do remember long time ago we had some tool to visualize this kind of information.
Any ideas on how to find out? I guess some Eclipse plugins can work, but I am totally new to this area and have no clue about the better ones...
I personally use JVisualVM which is found in every JDK /bin folder installation. You can attach to your running process and watch the memory and objects and their size.
There is no magic bullet to profiling. If you have a SessionSxoped bean named FooBean I open up VisualVm and I go to the Classes tab and filter by FooBean. I then use my load testing tool to simulate real world use and I monitor how many instances of Foo? How much heap are those instances taking? Are they being garbage collected etc.
It takes a little bit of learning but you will get better at it the more you use it.
We are evaluating few options for developing a telecommunication related application platform (and migrating/consolidating some of the standalone apps into the new platform). One of our main concerns is the ability to handle high volume of requests during peak hours.
We feel the TorqueBox seems to an interesting solution worthy of consideration because:
Speed (Next to pure Java performance)
Faster development time over Java
Maintainability
Support for threads/concurrency even though it's Ruby
Faster/Easier front end development with Rails
...
RedHat supported and runs on JBoss (scalability, future development and ability to call Java if necessary)
Has anyone developed/deployed similar application(s) with JRuby/TorqueBox?
Any serious performance bottlenecks ahead? (or why we shouldn't use JRuby and should stick with Java?)
The answer is YES but be aware of memory leaks (gems, threadsafety issues, etc). You have to be familiar with tools like VisualVM, Eclipse MAT and/or NewRelic.
We're successfully using Torquebox on production for some clients on amazon EC2 handling 60k-80k visits per day (new c3 instances are great for Java).
Deployment is also an issue. We're unable to setup any kind of rolling restart because of memory consumption. So every time we deploy using Capistrano a full JBoss restart is needed (no big issue for us).
Bests,
Antonio
yes any mature Java web-server with JRuby is a valuable option. the details of handling high-loads on peak hours will really depend on what kind of app you'll be running, how much "hardware" can you afford to use but in general it's achievable but be aware there might still be some "gotchas" e.g. Ruby libraries (gems) that do not handle thread-safety well. you simply need to understand how to proceed than - which seems you do since you're want to use 'Celluloid.IO' :)
I recently added GWT to our project to implement an Ajax feature of our web app. The other devs are complaining about the extra time GWT compile adds to the build and are asking why I didn't use JSON and jQuery instead. What should I tell them?
Try to make the build smarter, if it isn't already: The GWT (client) part should only be re-compiled, when the client source changes. I assume, it's mostly you who changes that source, so the other developers won't experience the pain.
Caveat: This doesn't work of course, if your client source shares code with the existing project (I assume, it's a Java project on the server side?). But maybe you should avoid shared code in your case: Even though that's violating the DRY (Don't Repeat Yourself) principle, realize that you'd violate it anyway, if you didn't use GWT.
However, if you do reuse code from the server project, then you have a good argument, why you used GWT.
If developers have to compile the whole GWT stuff (all the permutations) in order to develop application it is real pain. Starting from GWT 2 you can configure the webapp project to be run in "development mode". It can be started directly from eclipse (Google plugin) thanks to built in jetty container. In such scenario only requested resources are compiled, and the process is incremental. I find this very convenient - GWT compilation overhead in our seam+richfaces+GWT application is very small during development cycle.
When it comes to application builds there are several options which can speed up GWT compilation. Here is checklist:
disable soyc reports
enable draftCompile flag which skips some optimization
by adjusting localWorkers flag you can speed things a bit when building on multi-core CPU
compile limited set of permutation: e.g. only for browsers used during development and only for one language
Release builds of the webapp should have draftCompile disabled though. Also all the laguage variants should be enabled. Maven profiles are very useful for parametrization of builds.
What was the reason you used GWT instead of JSON/jQuery?
I would ask the same question since for what you need, GWT may not be legitimately needed.
In my experience, I totally understand the complaints you are getting. GWT is a wonderful technology, and it has many benefits. It also has downsides and one of them is long compile time. The GWT compiler does lots of static code analysis and it's not something that has an order-of-magnitude solution.
As a developer, the most frustrating thing in the world is long development-deploy-test cycles. I know how your developers feel.
You need to make an architectural decision if the technological benefits of GWT are worth it. If they are, your developers will need to get used to the technology, and there are many solutions which can make the development much easier.
If there was a good reason for using GWT instead of pure javascript, you should tell them this reason (skills, debugging for a very hard to implement problem, you didn't want to deal with browser compatibility, etc). If there is no good reason, maybe they're right to be upset.
I use GWT myself and I know about this compile time :-)
If you used GWT for an easy-to-implement-in-javascript widget or something like that, maybe you should have consider using javascript instead.
What tool you're using to compile project?
Long time ago I've used ant and it was smart enough to find out that, when none of source files for GWT app (client code) has changed, the GWT compiler task was not called.
However, after that I've used maven and it was real pain, because it's plugin didn't recognize the code hasn't changed and GWT compilation was run all and over, no matter if it was needed or not.
I would recommend ant for GWT projects. Alternative would be rewriting the maven plugin or getting developers used to long compile time.
I have a stock mac-mini server (2.53GHz, 4GB, 5400RPM drive) which I use for iphone development. I am working on a smallish app. The compilation seems to be taking longer and longer (now about 20min). The app is about 20 small files totaling 4000 lines. It links to C++/Boost.
What suggestions do you have to speed up the compilation process? Cheaper will be better.
Sounds like the system is swapping, which is a common problem when compiling C++ that is STL heavy. GCC can be a complete memory pig in such a situation and two GCCs at once can easily consume all memory.
Try:
defaults write com.apple.Xcode PBXNumberOfParallelBuildSubtasks 1
And see if that helps.
If it doesn't, then the other answers may help.
As others have noted, that's way in excess of what you should be expecting, so it suggests a problem somewhere. Try toggling distributed builds -- depending on your setup it may improve things or slow them down (for a while we had a situation where one machine was servicing everyone else's builds but not its own). If you have a 1Gb network then you may get a bit of extra performance from distributed builds (especially if you have a couple of spare macminis). Also enable precompiled headers, and put both boost and cocoa headers in it.
If things are still slow then it's worth running activity monitor to ensure that you don't have some other process interfering, or even Instruments to get some more detailed information. You could find that you're trying to compile files on a network drive for instance, which will certainly slow things down. Also inside Xcode try running the option to preprocess a file and see what's in the file contents (available via right-click) to check that you're not compiling in loads of extra code.
Also with boost, try slimming it down to find only the bits you need. The bcp tool that comes in the distribution will copy only the packages you ask it to, plus all the dependencies, so you're not building stuff you won't use.
Include all your boost headers in the precompiled header for your project.
I concur with Eiko. We're compiling projects that are vastly larger (including boost libraries) in much shorter time.
I'd start by checking logs. You can also view the raw compiler output in the build window (Shift+CMD+B or in the Build menu->Build Results). Xcode just makes straight gcc or llvm calls, so this may give you a better idea of what's actually happening during the build process.
There is something messed up. We are compiling bigger projects in fractions of the time.
I have a client that's running an application based on JBoss 4.0.5, Seam 1.2 and RichFaces 3.0.1. Their system is having performance problems due to the fact that a lot of data is coming back from the server to be displayed on screen and it seems like the rendering of that data is taking forever. The data brought back is displayed in a tabbed interface, but the tabs aren't currently being loaded individually, but all at once.
I'm trying to build up a case to present to the client on the benefits of upgrading to never version of RichFaces, which, as I understand it, has added a great number of features related to tabbed panels and being able to use ajax to page the data and load the chunks you actually need to display at the moment, and not the rest that's in other tabs.
The move to a newer version of RichFaces will also result in never versions of Jboss and Seam, as the current production build of RichFaces 3.2.1 requires JSF 1.2.
IF anyone has some suggestions or experience on performance of current versions RichFaces, paging, etc, I would really appreciate some feedback.
I haven't noticed much of a performance improvement by upgrading through various Richfaces versions. You're better off optimizing the code that is involved in the rendering - for example checking whether code is called mutliple times (as is the case when logic is placed in a getter).
I've found the bean-timing interceptor (#MeasureCalls) that Tobias Hill outlines in the Seam forum to be absolutely fantastic - more so than a profiler for specific problems (probably less so if you don't know where to start looking). It lets me track down those methods that are called more often than required and allows me to streamline my beans.
The forum link is : http://www.seamframework.org/Community/SeamPerformanceProblemRewardingWorkaround
One warning... I recently upgraded to JBoss 5.1.0GA, JSF 1.2, etc... so that our software stays current, but there is a drawback. JBoss 5 uses -significantly- more memory than JBoss 4, and takes longer to start. It would be wise for you to test our your new configuration on one machine before attempting to switch system-wide.
Use a profiler and do it for yourself. Only you have the application. Only you know which combination of components are "slow". I think you can measure it for yourself very fast.
p.s. show us the results ,-)
I find the Apache implementation of JSF1.2 much better the the Apache implementation of JSF1.0. I use a little RichFace 3.2 and it seems fine, still a bit too much information being sent on the ajax requests from the client so RichFaces Ajax executes much slower then a hand crafted AJAX solution, but code very much faster in RichFaces.