• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
codetemplar

graphic card memory leak

7 posts in this topic

Hi all,

I am monitoring my graphic card memory usage by running an ati tool called memory viewer. I see that the amount of memory being used gradually increased after 30 times of running my game ( i dont mean running it 30 times at the same time. I mean running it once, exiting, then running again, repeat 30 times ). I was unaware it was possible for a windows directx game to leak graphics memory because i thought windows gaurenteed to release the resources upon the game process exiting, just like it does with system ram. Am I correct? If so then it must be another process chomping away at the memory but when i end all processes the graphics memory never falls back down to what it started at.

Thanks
0

Share this post


Link to post
Share on other sites
First thing that comes to mind is driver issues, bugged tool, or your program keeps running hidden in the background.
This is however just a curiosity, the real issues is your applications memory leaks and the removal of them (if any).
0

Share this post


Link to post
Share on other sites
This isn't really proof that your game is causing a memory leak in VRam (in the same way that Windows Task Manager shouldn't be used to demonstrate regular memory leaks).

It's possible that the driver is resizing internal allocations to meet the demands of the applications using it - "warming up" in a way.

...Or there could be a bug in the ATI driver... in which case, it's not your fault and there's not much you can do.

Which OS are you using? How much does the reported value increase by each time you run your game?
0

Share this post


Link to post
Share on other sites
First of all thank you both for your responses

it approximately increases by about 2% every 10 loads, however it does fluctuate. Looking at my code I cannot see how I can be possibly leaking resources because I have a texture wrapper class which creates the directx texture in its constructor and releases it in its destructor. The constructor is private so can only be created by a static create function which returns a shared pointer to the texture wrapper class. So upon exiting the game when the share pointers reference count reaches zero the texture it refers to will be released. I have confirmed this works correctly.

All of this is part of a gaming library that I have wrote. I have made similar games using the same library and they do not seem to affect the amount of memory left when constantly loading and exiting them.

The reason why this is a problem is because if I load and exit long enough the game eventually starts running very slow due to the lack of vram available and causes thrashing.

I am using windows XP.

I am really out of ideas because I was convinced that the operating system should release the VRAM resources when that process has exited (I am certain the process has exited cleanly). However all my other games do not seem to suffer from this problem even though they are based on the same libraries.

Just out of curiosity could this be a contributing factor:

there is another application running that uses direct X that I wrote. Every time I start the game this other application releases the direct X device and sits and waits until the game has exited. At which point it exits itself and then it is loaded again by another process. I know that this seems an odd thing to do but there is good reason.. Its purpose is to display attracts for the games I have wrote and when a game is played it releases the device.

Thanks for any help
0

Share this post


Link to post
Share on other sites
The leak does disappear when not running this other process.
However when running this process and running my other games there still seems to be no leak. It is only when running this process and the one specific game.
Also every time I quit the game this other process also quits and is restarted. So Windows should also be freeing all of its resources so it should not be leaking

thanks
0

Share this post


Link to post
Share on other sites
This sounds very complex. Allow me to summarise my understanding: you have 3 processes, a monitor, a game and an "advertising" process.

[list=1]
[*]The monitor restarts this "advertising" process when one of your games finishes.
[*]Your "advertising" process detects when your games aren't running and relinquishes its device. It quits when the game finishes.
[*]The game is a standard process.
[/list]
I don't see why both the monitor and advert program need to detect the game closing.

Does the monitor allocate any memory or other resources? Are you 100% sure that the ad process finishes completely and cleanly?

Are you using the most up to date graphics card drivers?

We can but guess now. Unless you want to post this troublesome process we can't be more specific really.
0

Share this post


Link to post
Share on other sites
[size="2"]Everything you said is correct apart from number two,. The advertising process releases its device when it detects that a game is running and not when it has finished running.

I'm not 100% convinced that the advertising process does cleanly shutdown but I don't understand why that should make a difference because when it does exit shouldnt Windows clean up for it whether it's shutdown cleanly or not? Don't get me wrong I do want everything to close down cleanly, it's just if it isn't closing down cleanly I don't believe it should make a difference. Please correct me if I'm wrong.

Someone mentioned earlier that the graphics card may allocate more memory when not in use to meet the demands of the applications. Could someone please explain this further?

Drivers up-to-date
Thanks all for your help

[/size]
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0