I am developing a game using Java 1.6 along with LWJGL. I have a MacBook Pro and Windows 8 Desktop Computer, and I only code on a MacBook. Today I decided to test my game on my desktop computer, and something really strange happened. Task Manager shows a steady increase in memory usage in my application. At some point (about 700 MB) the whole computer becomes very slow, which gets better after I kill my gameplay. The strange part is that this problem will not occur on Mac OSX 10.9 or on Windows 7 (Parallels Virtual Machine on my Mac). Since I use various OpenGL calls, I have already used the Apple OpenGL Profiler, and there seems to be no problem, everything shows up as expected.
I also tried to analyze my application (on my Windows 8 desktop) using VisualVM, which strangely showed the expected results: stable heap size and heap usage.
What can happen? How can I debug this?
Edit:
I just found out that the same problem occurs if I boot into Windows 7 instead of using Parallels Virtual Machine on my MacBook Pro. I think the problem is with Windows.
Edit 2:
I tested the code, selecting some parts from it (the game ends at the end of the loop), and I noticed that the problem occurs in the last part that I encoded: Lighting System. There is a function that is called every 16 ms called tick () inside each system. If I release the tick () function of the lighting system, the problem will disappear. I tried removing parts of the tick function to find out what would happen. These functions work by querying which game objects produce light (and generate shadows) and then actually display the shadow textures. Everything worked fine until I started the rendering process, which consists of several shader passes, each of which looks like this:
',' fbo ',' distanceShader distanceTexture ' , reutilize.
layer.setTexture(SpriteSheet.teste.getTexture());
layer.setShader(distanceShader);
fbo = new Framebuffer(new Vector2f(light.getCurrentRadius() * 2, light.getCurrentRadius() * 2), new Vector3f(1f, 1f, 1f), 0f);
fbo.init();
fbo.begin();
distanceShader.bind();
distanceShader.setUniform("transform", transform.getOrthographicTransformation(new Vector2f(position.getPosition().getXInt(), position.getPosition().getYInt())));
distanceShader.setUniformf("lightRadius", light.getCurrentRadius());
distanceShader.setUniformf("ambientLight", ambientLight);
render();
fbo.end();
distanceTexture = fbo.getTexture();
fbo.dispose(false);
, , , . , , . , . , (, "distanceTexture" tick()).