Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Framerate cut in half when running by clicking jar vs command line or netbeans  (Read 1059 times)
0 Members and 1 Guest are viewing this topic.
Offline goblinJoel

Junior Member


Medals: 2



« Posted 2014-01-16 10:40:27 »

The framerate on my game drops from 16-19 to 10 when I run it from a jar by double-clicking. Running it from the same jar by command prompt or from the project itself in the IDE gives me the higher framerate.

I'm using LWJGL, but I've found posts about this problem both elsewhere and here by people not using OpenGL. No solutions that I noticed though.

Any ideas?
Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #1 - Posted 2014-01-16 11:36:24 »

It could be that Netbeans is taking up resources. I realize that is a very common trait on older computers and laptops. Netbeans isn't always a memory hog, but it totally depends on how it is configured.

Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2014-01-16 12:16:22 »

Which JVM are jars associated with? You're not accidentally using an old JVM when double clicking, are you? There have been some noticeable performance increases between the major versions.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Andre Lopes
« Reply #3 - Posted 2014-01-17 01:17:25 »

It could be that Netbeans is taking up resources. I realize that is a very common trait on older computers and laptops. Netbeans isn't always a memory hog, but it totally depends on how it is configured.

"It could be that Netbeans is taking up resources."
What? That doesnt make sense.Why blame the IDE? I use netbeans and that never happened.Plus, if it was netbeans, it would have to be running.


goblinJoel,if you are using netbeans make a profile analysis , post screenshots if you dont understand it.


Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #4 - Posted 2014-01-17 01:47:49 »

Careful. I am pretty aware of the profiler of Netbeans and its capabilities. Post solutions to the problem, and don't dab too closely into the flames. Attack the argument, not the person. You'll be highly respected that way.

Offline Andre Lopes
« Reply #5 - Posted 2014-01-17 02:00:39 »

Careful. I am pretty aware of the profiler of Netbeans and its capabilities. Post solutions to the problem, and don't dab too closely into the flames. Attack the argument, not the person. You'll be highly respected that way.
? What!?
I just said that its not the Ide's fault. Also, i meant for goblinJoel to check profiler, not you.And i did post the solutions.

God Bless.
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #6 - Posted 2014-01-17 03:17:05 »

If you have both 64 and 32 bit version of java installed,  it's possible that the OS will use 32 bit jvm for running jar that are opened by double click, and 64 bit jvm for running everything else.  The 64 bit jvm is considerably faster than the 32 bit jvm at the cost of longer start up time and more memory consumption.
Offline goblinJoel

Junior Member


Medals: 2



« Reply #7 - Posted 2014-01-20 07:14:05 »

Looks like you guys are probably right!

If I search "java" in the start menu, it quickly comes up with Configure Java, About Java, and java.exe. If I open Configure Java, I'm seeing that I have Java 1.7.0_45 listed first in the User tab, with 1.6.0_31 second, and both are enabled. The System tab just has 1.7. All are located in Program Files (x86). So it looks like Windows is set up to use 32bit JREs.

If I instead open About Java, it tells me 1.7.0_45-b18. Presumably the same JRE that is listed first in Configure Java.

However, in control panel (Win7) -> Java, it lists only 1.6.0_26 in both User and System tabs, located in Program Files. So, that would indicate Windows is set up to use a 64bit Java 1.6 JRE.

In Control Panel -> Programs and Features, it looks like I have the following installed:
Java 7 Update 45
Java 6 Update 26 (64bit)
Java 6 Update 31
Java SE Dev Kit 6 Update 26 (64-bit)
Java SE Dev Kit 7 (64bit)

The NetBeans project is set to use JDK 1.6 as the platform. Under Tools -> Java Platforms, I have JDK 1.6.0_26 as the default, followed by JDK 1.7.0. I did pick 1.6 intentionally, because I assumed developing for Java 6 would have a broader install base than Java 7, and it would let me get a better idea of how it would run on less up-to-date systems even if that wasn't true. I don't know if that's really the case.

If I check java -version in command prompt, I see:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20,1-b02, mixed mode)

I guess what's going on is that command prompt and NetBeans are set to use 64bit Java 6, while double-clicking jars is set to use 32bit Java 7. Does that look like the case to you guys?

...how do I straighten Windows out? It has two separate Java Control Panels, one accessible from Windows Control Panel (the 64bit Java 6), one accessible from the start menu (the 32bit Java 7 and Java 6).

And what should I expect users to have if it's this messy on mine?! Thanks for your help in at least steering me in the right direction so far.
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2014-01-20 15:44:52 »

Well firstly just get rid of Java 6 because it's kinda ancient.

Cas Smiley

Offline goblinJoel

Junior Member


Medals: 2



« Reply #9 - Posted 2014-01-21 15:26:02 »

Haha, thanks for the advice.

Hm... well, I'm a little blurry on how forwards compatibility works in Java. If I wrote something in Java 7, and someone had Java 6, would it always work, sometimes work depending on the features I used, or never work? (Or maybe I could bypass the whole issue by distributing the right JRE with the game... I think I've heard you can do that.)

If there's no reason to use Java 6, then I might as well follow your advice.

As a side note, it's my personal irrational goal to make sure the game can run on my netbook, which, despite coming with Windows 7 Starter, for some reason only supports OpenGL 1.4. Even though it was made in 2009. So I guess I have a lot of sympathy for people on old machines that just want to play a game that doesn't really look like it should need a new machine.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2014-01-21 15:28:55 »

If you wrote something in Java 7 it can be post-processed to make it work with Java 6 sometimes. However you are right in thinking that what you should be doing is distributing a JRE with the game itself; OpenJDK on MacOS (10.7+) and Linux, and the Oracle JRE for Windows.

There's a slim chance there's some newer video drivers for your laptop; OpenGL 1.4 is proper ancient.

Cas Smiley

Offline goblinJoel

Junior Member


Medals: 2



« Reply #11 - Posted 2014-01-21 15:34:46 »

Thanks, Cas!

I'll have to remember that about distributing the JRE with the game. I'm guessing a bit of searching will reveal some solutions or at least instructions for the best ways to do that.

Unfortunately, I'm pretty sure my netbook's video drivers are as up to date as I can get them. Intel 945GM does not appear to be the hottest thing around. Which brings up the related question of how to use OpenGL extensions with LWJGL, but I'll search around a bit more before starting a thread about that. (Unless you already have a link handy. Tongue )

Btw, I think it's cool that you frequent these forums. I loved Revenge of the Titans (despite not being able to tell what upgrades would do ahead of time), and I can't help but wonder how you find/steal time to answer newbie questions.
Offline gouessej
« Reply #12 - Posted 2014-01-21 15:44:44 »

As a side note, it's my personal irrational goal to make sure the game can run on my netbook, which, despite coming with Windows 7 Starter, for some reason only supports OpenGL 1.4. Even though it was made in 2009.
It uses Microsoft GDI renderer, a kind of OpenGL emulation through Direct3D. You're lucky as lots of older laptops only get a driver supporting OpenGL 1.1, things could be worse. Maybe you need to use "allowSoftwareOpenGL=true", I'm not the best person to speak about LWJGL.

Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #13 - Posted 2014-01-21 15:51:45 »

'tis true, I've just checked; The 945GM only has hardware support for OpenGL 1.4 :S ... I'd accidentally spill a cup of coffee on that laptop.

Cas Smiley

Offline goblinJoel

Junior Member


Medals: 2



« Reply #14 - Posted 2014-01-21 16:09:21 »

Lol.

It feels inappropriate to reply just to say that. This forum feels too official. Maybe something's wrong with me.
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #15 - Posted 2014-01-21 17:28:18 »

Indeed, you aren't allowed to just say LOL Wink Try it. <edit> Actually ignore me, I thought there was a minimum post size restriction on JGO but it was a different forum I was thinking of.

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (12 views)
2014-07-24 01:59:36

Riven (10 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!