LWJGL
May 22, 2012, 05:03:46 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: 1 [2]
  Print  
Author Topic: LWJGL 2.3 Released  (Read 17291 times)
Estraven
Regular nerd
**
Posts: 53


« Reply #15 on: March 08, 2010, 08:05:31 »

Hi,
I have trouble with this new release :

>> new: Removed support for indirect buffers as arguments to AL/GL functions

I used to declare non direct buffers, so I had to adapt my code. It now works using small textures, shader loading and so on.

However, when I load big textures (4096*4096 pixels) I get OutOfMemory exception.
I never had this problem with non direct buffers. My application used to load several such textures.

I tried to initiate the JVM using -XX:MaxDirectMemorySize=1024m and -Xmx1024m, but it's still occuring...
damn ! a 4096*4096 ARGB texture is only 64MB.
Any idea what's happening ? Can I initialise a 64MB buffer using "BufferUtils.createByteBuffer(67108864);" ?

By the way, i'm running windows Vista 32bit (Pro) and the lastest version of Java JDK.

Thanks,
Estraven



Logged
princec
Nerdus Imperius
*****
Posts: 1782



WWW
« Reply #16 on: March 08, 2010, 08:33:48 »

Tried -Dsun.nio.MaxDirectMemorySize ?

Cas Smiley
Logged

Estraven
Regular nerd
**
Posts: 53


« Reply #17 on: March 08, 2010, 10:36:44 »

Hi,

It doesn't change anything. I tried on another computer (similar hardware : nvidia GTX 285 on Win Vista 32 - drivers 196.21)
On this other computer, no OutOfMemory, but all 4096x4096 texture aren't loaded. each channel equal to 0 on : ARGB (checked through GLSL shaders)
2048x2048 textures load and display ok...

Finally, on the same computer (GTX 285) but Win 7 - 64bits, it renders ok....

Everything work well on every computers/OS on LWJGL 2.2 and using non direct buffers.
Any other ideas ? I'm quite desperate here...

Thanks,
Estraven

EDIT :

It seems like VM arguments   "-Dsun.nio.MaxDirectMemorySize=1024m -Xmx1024m"  are responsible.
On my 32bit OS, I only have 1500MB free, thus, only  "-Dsun.nio.MaxDirectMemorySize=1024m -Xmx512m" works.
On my 64bit OS, (4GB instead of 3GB) I have 2.3GB of free RAM, thus "-Dsun.nio.MaxDirectMemorySize=1024m -Xmx1024m" is working...
I made the assumption that is was "maximum" size, but was I wrong ?

Anyway, it works again.

Thanks for the good work on LWJGL !

Estraven.


Logged
delt0r
Newbie
*
Posts: 25


« Reply #18 on: March 09, 2010, 02:07:53 »

It sounds like a lot. Are you "reusing" the direct bufferers, or are you just allocating new ones for everything. I basically have a small set of direct bufferers that i reuse to send stuff to lwjgl and have not needed to know anything about -Dsun.nio.MaxDirectMemorySize despite using many 100s of megs of textures and vertex data.
Logged
Estraven
Regular nerd
**
Posts: 53


« Reply #19 on: March 09, 2010, 03:03:24 »

I agree, it's a lot of memory... So I spent the past hours to understand what was happening.

I was only reusing small buffers  Embarrassed (like texture/vbo/shader ID generation)
I changed my texture loading code. Now I use a single buffer, reallocating it only when the current one is too small to fit the texture (and calling System.gc() to free the previous one).
Indeed, now it works without specifying any  MaxDirectMemorySize ...  Cool

In fact, here's what happened :
in some cases, I have a lot of non-graphical stuff in memory, so i do need -Xmx512m.
As I was using non-direct buffer, they were allocated within the JVM memory and everything was ok. (even using a huge set of buffers, disallocated automatically by the Garbage Collector.)
But when I switched to Direct Buffer, my code was really wrong !

Thanks for all the answers. It works just fine now !  Smiley

Estraven.






Logged
Socke
Newbie
*
Posts: 3


« Reply #20 on: April 06, 2010, 13:16:14 »

Can someone update the basic Wiki?

I have

Quote
Exception in thread "main" java.lang.IllegalStateException: Function is not supported
   at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:64)
   at org.lwjgl.opengl.GL11.glBegin(GL11.java:692)
   at Main.main(Main.java:62)

on

Quote
           // render using OpenGL
           GL11.glBegin(GL11.GL_QUADS);
                GL11.glVertex3f(0,0,pos);
                GL11.glVertex3f(1,0,pos);
                GL11.glVertex3f(1,1,pos);
                GL11.glVertex3f(0,1,pos);
           GL11.glEnd();

With ATI Radeon 5770 on Vista 64.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #21 on: April 06, 2010, 22:19:03 »

which page?
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Socke
Newbie
*
Posts: 3


« Reply #22 on: April 08, 2010, 10:18:35 »

http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/display/basicdisplay

and

http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicopengl
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #23 on: April 08, 2010, 13:57:51 »

as expected the wiki pages work fine ... are you sure you're copying it correctly?
have you created the display prior to making opengl calls?
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
princec
Nerdus Imperius
*****
Posts: 1782



WWW
« Reply #24 on: April 09, 2010, 02:03:49 »

That's the missing compatibility context bug... Wiki page should maybe be updated to check for its availability. But I think Spasi's fixed the issue in LWJGL itself (as no GL drivers currently don't actually expose GL1.x methods in reality, it was a bug).

Cas Smiley
Logged

spasi
Nerdus Imperius
*****
Posts: 643



WWW
« Reply #25 on: April 09, 2010, 04:28:47 »

Socke, you're either using ContextAttribs somehow or you're running an LWJGL build older than 2.3. With the default Display.create you shouldn't be having this problem with 2.3.
Logged

Socke
Newbie
*
Posts: 3


« Reply #26 on: April 11, 2010, 07:46:42 »

You are right. I have reinstall all and now it starts.

Does this look right?



Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!