Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (813)
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  
  JSR231 and Java2D gpu/memory interaction  (Read 1579 times)
0 Members and 1 Guest are viewing this topic.
Offline mantesat

Junior Devvie




Java games rock!


« Posted 2006-09-28 07:26:38 »

Hi all

I 'm working on an application which uses java2d to produce some images (using afine transformations), to be used as textures for a 3d scene rendered using JSR231 (latest version). Everything goes well, but after some random time (1-10 minutes of rendering and creating textures), the CPU load for my application goes to 100%. I'm using  a thread that is responsible for creating textures from java2d created images, and a queue which contains all the "jobs" waiting to be transformed into images by the thread. After the CPU load goes to 100%, no jobs from queue are processed further.

I got the following thread dump when that happened:

"TilePainter3D 0" daemon prio=2 tid=0x0d9e7650 nid=0x870 runnable [0x1a3ef000..0x1a3efd68]
        at sun.java2d.loops.ScaledBlit.Scale(Native Method)
        at sun.java2d.pipe.DrawImage.scaleSurfaceData(Unknown Source)
        at sun.java2d.pipe.DrawImage.renderImageScale(Unknown Source)
        at sun.java2d.pipe.DrawImage.tryCopyOrScale(Unknown Source)
        at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
        at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
        at sun.java2d.pipe.DrawImage.transformImage(Unknown Source)
        at sun.java2d.pipe.ValidatePipe.transformImage(Unknown Source)
        at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
        at sun.java2d.SunGraphics2D.drawRenderedImage(Unknown Source)
        at gr.talent.map.painters.layer.SimpleImagePainter.drawGeographicFeatures(SimpleImagePainter.java:110)
        at gr.talent.map.rendering.Renderer2D.paintGeographicFeatures(Renderer2D.java:832)
        at gr.talent.map.rendering.Renderer2D.renderImpl(Renderer2D.java:750)
        - locked <0x0341fd88> (a gr.talent.map.rendering.Renderer2D)
        at gr.talent.map.rendering.Renderer2D.renderImmediately(Renderer2D.java:347)
        at gr.talent.globe.DataHandler.updateImageData(DataHandler.java:130)
        - locked <0x041a8ad0> (a java.awt.image.BufferedImage)
        at gr.talent.globe.TileRenderingJob.execute(TileRenderingJob.java:49)
        at gr.talent.utils.JobScheduler$JobRunnable.run(JobScheduler.java:456)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

This (if I'm correct) shows that there is an infinite loop at sun.java2d.loops.ScaledBlit.Scale(), and that's why everything freezes. I'm wondering if the following is a java2d problem, or is related to the use of JSR231. At first, I thought that I might go low on gpu memory, and that causes problems on java2d processes. I checked my gpu memory (using the ATI tray tool, I'm using an ATI Mobility Radeon 9000), but it stays well above critical limits. Can Jogl/OpenGL affect the java2d processes? Has anyone come across such a problem?

Most important, how can I isolate this to see if it is a java 2d problem, or it is related to opengl processes?

Thanks in advance
N

Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2006-09-28 10:37:00 »

You're running on WIndows, correct? Have you specified -Dsun.java2d.noddraw=true on the command line? My first guess would be that maybe there is some DirectDraw work being done inside the Java2D implementation during your BufferedImage rendering, and DirectDraw and OpenGL are incompatible at the driver level.
Offline mantesat

Junior Devvie




Java games rock!


« Reply #2 - Posted 2006-09-28 11:29:39 »

Yes, Windows it is. I haven't specified the noddraw parameter, so this might be the cause. I'll give it an extensive try. I also mentioned this problem to a person a lot more experienced in java2d  than me, and he suggested that numeric extremities in affine transformations used image rendering could cause such erroneous behavior. I'll look into that direction also, in case something goes wrong with my arguments in image rendering .

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

 
cybrmynd (138 views)
2017-08-02 12:28:51

cybrmynd (159 views)
2017-08-02 12:19:43

cybrmynd (153 views)
2017-08-02 12:18:09

Sralse (169 views)
2017-07-25 17:13:48

Archive (646 views)
2017-04-27 17:45:51

buddyBro (766 views)
2017-04-05 03:38:00

CopyableCougar4 (1300 views)
2017-03-24 15:39:42

theagentd (1264 views)
2017-03-24 15:32:08

Rule (1237 views)
2017-03-19 12:43:22

Rule (1312 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!