简体   繁体   中英

java app run much faster outside netbeans

When I run code inside NetBeans it is very slow. However, when I convert the code to a standalone application it runs 5 times faster. That is awkward because it won't let me test it as it will truly run on a mac. I'm using netbeans 8.

The application involves heavy memory usage. I think maybe, just maybe, netbeans is limiting the size of the heap. Anyway passed the -Xmx2048m flag to the program.

clue: when I build the software to an .app file, then go inside that app package and edit the .plist file, I manually add the line2:

<key>VMOptions</key>
<string>-Xmx1024m</string>

and that's the only way to make it run fast as I would like. And that is only as standalone, outside netbeans.

You can change those parameters in netbeans by changing the Run Configuration (Right click your project and select Properties -> Run). It could also just be a simple case of the debugging enviroment overhead causing the slowdown.

You can also try to set the heap space used by the IDE itself.

http://wiki.netbeans.org/FaqSettingHeapSize

If the application is SWING-related, there were a number of performance issues in the JDK that were affecting Retina Macs . You should also try upgrading to a JDK release >8u40, where these problems were fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM