Skip to main content

jdk1.6.0_14 holding onto DirectX resources

7 replies [Last post]
stephen46
Offline
Joined: 2009-06-19

Hi,

Hoping someone can help me with the following problem:

I have built a media centre under jdk1.6.0_14 which involves a significant amount of 2D image manipulation, gradient and transparency operations. All works fine and the animation is greatly improved by the new DirectX acceleration.

The problem is after a while I get a Green Screen whenever I try to play a video in any DirectShow media player (e.g. MPC).

Please note the MPC process is separate to the media centre VM process. I can immediately fix the problem by exiting the VM - I dont even need to restart the MPC instance it just automatically fixes itself.

It would appear to me that the JVM is holding some resources within DirectX at the global level, which stops MPC from using them. When the process exits, they are free-ed for MPC (or any other DirectShow player) to resume normality.

Any ideas of what may be going on and how to debug / monitor to see what the resources are?

regards

Steve

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
trembovetski
Offline
Joined: 2003-12-31

Java2D uses Direct3D for hw acceleration in the same way that any other application would, there aren't "some resources within DirectX at the global level" that we could be holding. The application has only access the the resources the Direct3D runtime allocated for this application.

Have you tried running any other applications which use Direct3D and see if they behave in the same way? Like may be some demos from nvidia/ati web sites.

This sounds like a driver issue.

stephen46
Offline
Joined: 2009-06-19

Tried a couple of Nvidia demos - they work without JVM, continue to work with JVM until after about 5 minutes of execution - it's a carousel that rotates with images of different video files. Exiting JVM results in demos working again.

I have the latest Nvidia drivers from their website, version 185.85 which has been WHQL signed. The graphics card is a little old - it's a Innovision GeForce 6200 256MB DDR2 64Bit AGP -

Maybe Nvidia's regression tests on older cards isnt up to much?

trembovetski
Offline
Joined: 2003-12-31

We've certainly seen driver-related issues with older boards (6200 specifically) before.

Does it work the other way around? Like if you run several nvidia demos for a while? And may be then start a jvm?

Also, does it happen when you run any other Java2D applications (like Java2Demo or SwingSet)? I wonder if your application could be leaking resources (video memory).

Message was edited by: trembovetski

stephen46
Offline
Joined: 2009-06-19

I will give your suggestion a go - is there a tool that could give me an insight into if my app. is leaking video memory? (something like purify but for video memory)

thanks

Steve

trembovetski
Offline
Joined: 2003-12-31

You could use any Java profiler (like VisualVM), and see if you're leaking VolatileImages, or BufferedImages.

In theory only VolatileImages could be a problem since BufferedImages cache their contents in a "managed" Direct3D texture, meaning that Direct3D can push them to system memory if vram is needed and texture isn't being used.

stephen46
Offline
Joined: 2009-06-19

Will give it a go. However I have verified I do not get the same behaviour on other systems with different graphic cards, and therefore this coupled with the Mobo being 7 yrs old, I have decided to bin it and get a new integrated board with on board HDMI 1080p. I dont use it for games and the P7NGM Digital works a charm

thanks anyway

stephen46
Offline
Joined: 2009-06-19

sorry forgot to add if I set DirectX acceleration off with -Dsun.java2d.d3d=false , the problem goes away and cannot be repeated

regards

Steve