Sign in to follow this  
Janissary

OpenGL Memory usage increasing over time

Recommended Posts

Janissary    45

Hi. I have an empty OpenGL 3.3 application using GLEW and GLFW, with a simple code like this:

bool running = true;

if( !glfwOpenWindow( 800,600, 0,0,0,0,0,0, GLFW_WINDOW ) )
{
    glfwTerminate();
}

glewInit();

while( running )
{
    glClear( GL_COLOR_BUFFER_BIT );
    glfwSwapBuffers();
    running = glfwGetWindowParam( GLFW_OPENED );
}

glfwTerminate();

When I run the application and open the Windows Task Manager, the memory usage of the process doesn't stop growing, it starts at something near 8,600 K and then this number is increased by 4 every 3 to 10 seconds, approximately.

 

Oh my god, what do I do?

Share this post


Link to post
Share on other sites
Barbossa    967

Stay calm ;)

 

It does not seem like a real leak, at least if it is growing so slow. I don't see any error in your code. The taskmanager is not really a tool for checking for memory leaks, so you might go ahead and check out a leak detector like https://vld.codeplex.com/releases for Visual Studio in case you have a feeling that there is indeed a leak.

 

Doesn't look like it for me, but checking never hurts :)

Share this post


Link to post
Share on other sites
Janissary    45

There are no memory leaks, I used the CRT thing before for checking. I think it it is not a leak problem, because there are no allocations made by me on the loop, only these simple gl calls. I tested other non-empty OpenGL applications, they have a steady usage. They use FreeGLUT.

 

I tried to create a window and context manually, and drew a simple triangle, the memory usage is stable.

 

Maybe this is glew/glfw problem. Or Is that something I shouldn't be worried about?

 

Oh my god, what should I do now :(

 

Thank you for your reply, Barbossa.

Share this post


Link to post
Share on other sites
Kaptein    2224

I recommend using glfw3

hopefully that solves your problem :)

 

I have been using glfw before, and i've never had any growth, even slow

maybe it's just the newer nvidia drivers.. it could be anything

Share this post


Link to post
Share on other sites
Janissary    45

Didn't know GLFW had a new version. I won't use glfw3. It has become so stupid. There is no library for Visual Studio 2010. Only for the Visual Crap 2012. Even the website looks stupid now. Even the function names: glfwWindowShouldClose, what the Hell? The header filename, glfw3.h? GLFW 2.7 was not glfw27.h, simply glfw.h.

 

I think I will search for another library to do this job. Or do it manually if I don't find one.

 

Thank you Kaptein.

Share this post


Link to post
Share on other sites
Janissary    45
I don't give a **** to this stupid number, keep pressing this stupid down arrow if you want, ********. Edited by swiftcoder
inappropriate language hidden.

Share this post


Link to post
Share on other sites
Janissary    45


What? It's right here: glfw-3.0.3.bin.WIN32.zip\glfw-3.0.3.bin.WIN32\lib-msvc100\glfw3.lib.

 

Yes it's right there. My mistake, sorry.

 


Hmm? What do you have against Visual Studio 2012? It's solid and much more stable (in my experiences) than 2010.

 

It's full of useless features - too retarded-friendly, like everything tends to become over time.

 


It's a sign of the library community's health. To me, it appears much cleaner and organized.

 

Too retarded-friendly (like everything tends to become over time) and I couldn't find 2.7.7's documentation.

 


Check the documentation and read up on new functions you're not familiar with.

 

I was talking about the name of the function, which is stupid. It's the first time I see the word 'should' in a program.

 


Developing applications over time that eventually use different versions of the same library can make managing them in an IDE difficult. Visual Studio property pages help somewhat, but having an version number with the header and library names make it much more explicit and hard to mess up.

 

Why would one use two versions of GLFW in the same application? It's all the same crap.

 


This sort of caustic attitude isn't allowed these forums; try taking your frustrations to Twitter or Facebook.

 

That was unnecessary.

Share this post


Link to post
Share on other sites
Janissary    45

Not it wasn't necessary. Okay, screw GLFW, it is a shitty library. This thread has become a down-vote ocean, too many assholes. Not that I give a shit about that number.

Share this post


Link to post
Share on other sites
fastcall22    10846

It's full of useless features - too retarded-friendly, like everything tends to become over time.

Well, there's [tt]notepad.exe[/tt] and [tt]cl.exe[/tt]; knock yourself out. As un-userfriendly as it gets.
 

Why would one use two versions of GLFW in the same application? It's all the same crap.

You wouldn't use two different versions of a library in the same application, silly! If you have ever developed more than one application, then using the "latest" version of a library at the times of both applications' development are going to be different. Including [tt]glfw.h[/tt] in the application developed years earlier is going to break when you change your environment's paths to always use the latest versions of your libraries. (Again, with Visual Studio's property pages, this is possible.)
 

Too retarded-friendly (like everything tends to become over time) and I couldn't find 2.7.7's documentation.

The newest version of glfw I downloaded came included with the documentation; even 2.7.7 had documentation! glfw-2.7.7.bin.WIN32.zip\glfw-2.7.7.bin.WIN32\docs\
 

I was talking about the name of the function, which is stupid. It's the first time I see the word 'should' in a program.

You can use a macro to hide it, if you really want to. You could even comment it!
// Wow, I'd rather rebuild an entire cross-platform library than to use the word "should" in a program.
#define glfwWindowIsOpen(window) (!glfwWindowShouldClose(window))
Edited by fastcall22

Share this post


Link to post
Share on other sites
jbadams    25713

Janissary,

 

That is not an acceptable first reply to make after your previously issued warning.  You have been warned repeatedly for offensive and disrespectful behaviour, and have shown no sign of trying to participate constructively here.

 

As such, you are being permanently removed from our community -- please try to behave better in any other communities you join.

 

 

With the original poster banned and a number of posts off-topic I'm also closing this topic; anyone experiencing a similar problem should please feel free to start a new topic to get help.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Similar Content

    • By pseudomarvin
      I assumed that if a shader is computationally expensive then the execution is just slower. But running the following GLSL FS instead just crashes
      void main() { float x = 0; float y = 0; int sum = 0; for (float x = 0; x < 10; x += 0.00005) { for (float y = 0; y < 10; y += 0.00005) { sum++; } } fragColor = vec4(1, 1, 1 , 1.0); } with unhandled exception in nvoglv32.dll. Are there any hard limits on the number of steps/time that a shader can take before it is shut down? I was thinking about implementing some time intensive computation in shaders where it would take on the order of seconds to compute a frame, is that possible? Thanks.
    • By Arulbabu Donbosco
      There are studios selling applications which is just copying any 3Dgraphic content and regenerating into another new window. especially for CAVE Virtual reality experience. so that the user opens REvite or CAD or any other 3D applications and opens a model. then when the user selects the rendered window the VR application copies the 3D model information from the OpenGL window. 
      I got the clue that the VR application replaces the windows opengl32.dll file. how this is possible ... how can we copy the 3d content from the current OpenGL window.
      anyone, please help me .. how to go further... to create an application like VR CAVE. 
       
      Thanks
    • By cebugdev
      hi all,

      i am trying to build an OpenGL 2D GUI system, (yeah yeah, i know i should not be re inventing the wheel, but this is for educational and some other purpose only),
      i have built GUI system before using 2D systems such as that of HTML/JS canvas, but in 2D system, i can directly match a mouse coordinates to the actual graphic coordinates with additional computation for screen size/ratio/scale ofcourse.
      now i want to port it to OpenGL, i know that to render a 2D object in OpenGL we specify coordiantes in Clip space or use the orthographic projection, now heres what i need help about.
      1. what is the right way of rendering the GUI? is it thru drawing in clip space or switching to ortho projection?
      2. from screen coordinates (top left is 0,0 nd bottom right is width height), how can i map the mouse coordinates to OpenGL 2D so that mouse events such as button click works? In consideration ofcourse to the current screen/size dimension.
      3. when let say if the screen size/dimension is different, how to handle this? in my previous javascript 2D engine using canvas, i just have my working coordinates and then just perform the bitblk or copying my working canvas to screen canvas and scale the mouse coordinates from there, in OpenGL how to work on a multiple screen sizes (more like an OpenGL ES question).
      lastly, if you guys know any books, resources, links or tutorials that handle or discuss this, i found one with marekknows opengl game engine website but its not free,
      Just let me know. Did not have any luck finding resource in google for writing our own OpenGL GUI framework.
      IF there are no any available online, just let me know, what things do i need to look into for OpenGL and i will study them one by one to make it work.
      thank you, and looking forward to positive replies.
    • By fllwr0491
      I have a few beginner questions about tesselation that I really have no clue.
      The opengl wiki doesn't seem to talk anything about the details.
       
      What is the relationship between TCS layout out and TES layout in?
      How does the tesselator know how control points are organized?
          e.g. If TES input requests triangles, but TCS can output N vertices.
             What happens in this case?
      In this article,
      http://www.informit.com/articles/article.aspx?p=2120983
      the isoline example TCS out=4, but TES in=isoline.
      And gl_TessCoord is only a single one.
      So which ones are the control points?
      How are tesselator building primitives?
    • By Orella
      I've been developing a 2D Engine using SFML + ImGui.
      Here you can see an image
      The editor is rendered using ImGui and the scene window is a sf::RenderTexture where I draw the GameObjects and then is converted to ImGui::Image to render it in the editor.
      Now I need to create a 3D Engine during this year in my Bachelor Degree but using SDL2 + ImGui and I want to recreate what I did with the 2D Engine. 
      I've managed to render the editor like I did in the 2D Engine using this example that comes with ImGui. 
      3D Editor preview
      But I don't know how to create an equivalent of sf::RenderTexture in SDL2, so I can draw the 3D scene there and convert it to ImGui::Image to show it in the editor.
      If you can provide code will be better. And if you want me to provide any specific code tell me.
      Thanks!
  • Popular Now