Do as I say, not as I do. Trev's Blog

Wednesday Dec 12, 2007

As a campus evangelist, one of the most common complaints I hear about Netbeans is that it hogs memory.  While it is true that the IDE does have a moderate memory requirement, I think there are several underlying issues that affect this misconception.    Unfortunately, most students do their development on a laptop, usually with a gig or less of physical RAM.  This in itself is not a problem, unless you have too many other processes running.  From java-tips.org:

"If your Java process requires more memory than underlying OS can provide it can cause swapping of pages from/to disk. This results in significantly degraded performance.  It is sometimes useful to increase amount of memory available to the application to allow it manage memory more effectively and this can reduce the time spent during garbage collection cycles." 

Netbeans does not "hog" memory; it uses what it needs, and sometimes the OS isn't able to provide that.  I run Netbeans 6.0 on a Vista laptop with an Intel 2.0 GHz chip and 1GB RAM.  Fairly good specs, although these days one gig of RAM isn't that much.  I do notice increased memory consumption when running Netbeans, but only experience performance issues when building web apps and running Glassfish, usually.  Why?  Well let's start at the bottom.  Windows Vista and the Aero desktop consumes a large amount of memory in and of itself.  Now run the most comprehensive IDE in the world AND an application server AND the JavaDB database server, all on a laptop.  It shouldn't surprise you if things get a bit sluggish.    

Another issue: I/O operations.  From java-tips.org:

"During some tasks the IDE is performing many I/O operations. With a slow device this can cause slowdown of the whole application. Typical examples are resources accessed on network drives or plugable drives like USB disk, storages using compression or encryption and anti-virus applications guarding all accesses to files.  Notebooks running on batteries have slower I/O too."

It's also important to realize that Java's memory footprint is lower than you might think.  It's not as simple as adding up the numbers for all the javaw.exe processes in Task Manager.  You have to account for shared bytes; a lot of memory is shared between multiple processes, but the "Mem Usage" field adds that shared space to every process that uses it.  More on this here.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed