Java Settings for Netbeans 6.8 on OSX 10.5.8 to optimize cpu usage

后端 未结 6 1377
萌比男神i
萌比男神i 2021-01-02 19:07

Sorry I have several question relative to the same problem.

I am using Netbeans 6.8 on OSX 10.5.8 with java 1.6.0_17 and after about 5 minutes of work, the cpu usage

相关标签:
6条回答
  • 2021-01-02 19:16

    You could try to increase available heap for netbeans. The settings are in $NETBEANS_HOME/etc/netbeans.conf

    The interessting one is netbeans_default_options Default is: -J-Xms32m I would start with -Xms256m -Xmx512m with -J (prefix)

    EDIT: From netbeans.conf

    If you specify the heap size (-Xmx) explicitely, you may also want to enable
    # Concurrent Mark & Sweep garbage collector. In such case add the following
    # options to the netbeans_default_options:
    # -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled
    
    0 讨论(0)
  • 2021-01-02 19:16

    I have been using Netbeans since the 5 series, and it has always been a cpu and memory hog. I use it now only at work when I absolutely must. It doesn't handle large projects well and even on systems with fast hard drives, it still has a large amount of IO activity.

    This has been on every Windows system I've used it on, XP, Vista and 7. So it isn't just you. I've also tried playing with every memory setting that I could, and disabling all of the plugins I could and it never helped.

    If you can, you might want to try Eclipse. It is a lot more lightweight but getting started with different frameworks can be a bit harder since it doesn't include all of the hand holding.

    0 讨论(0)
  • 2021-01-02 19:25

    As you are using Mac OS X, you might try /Applications/Utilities/Activity Monitor.app or /Developer/Applications/Performance Tools/Thread Viewer.app to see what is impacting performance.

    0 讨论(0)
  • 2021-01-02 19:32

    While this is hardly an easy solution to implement quickly, I find that running Netbeans 6.9 on a multi-core processor works. While it might ramp up on one core, the other (3 in my case) are still free for other tasks. Given that you're on a Mac, YMMV.

    Of course, it would be better to avoid the CPU hog in the first place, but if you can't find the source, but still love the IDE (as I do)...

    0 讨论(0)
  • 2021-01-02 19:34

    Thank you for the advices which lead me to play around with netbeans.conf.

    here are my options that significantly improve the performances:

     -J-server
     -J-Xverify:none
     -J-d64
     -J-Xss2m
     -J-Xms256m
     -J-Xmx512m
     -J-XX:PermSize=32m
     -J-XX:MaxPermSize=512m
     -J-Dsun.java2d.noddraw=true
     -J-Dsun.java2d.opengl=true
     -J-Dsun.java2d.d3d=false
     -J-Dawt.nativeDoubleBuffering=true
     -J-XX:+UseAdaptiveSizePolicy
     -J-Djava.net.preferIPv4Stack=true
     -J-XX:+AggressiveOpts
     -J-XX:+AggressiveHeap
    
    its seems that important ones are:
     -J-XX:+AggressiveOpts
     -J-XX:+AggressiveHeap
     -J-d64
    

    Here are some useful links which inspired me:

    • http://java.sun.com/performance/reference/whitepapers/tuning.html#section4.2.5
    • http://performance.netbeans.org/howto/jvmswitches/index.html

    I don't try 6.7 because it is now satisfying. Hope it helps!

    0 讨论(0)
  • 2021-01-02 19:34

    I found that version 7.3 (PHP build) comes with about 25 plugins, and I don't need all of them. I've been able to disable around seven of them, and CPU performance seems to die down much more quickly to idle levels now. So, if you are having CPU problems - with NB on any OS - this is probably worth a shot too.

    0 讨论(0)
提交回复
热议问题