Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

I Like to "take a leak" now an again. But a noob question.Memory Leaks?

CurraCurra Member UncommonPosts: 34

Are "memory leaks" a client -side problem or a problem on my side? If client-side why can't they "fix" them?

Comments

  • WaterlilyWaterlily Member UncommonPosts: 3,105
    Originally posted by curra


    Are "memory leaks" a client -side problem or a problem on my side? If client-side why can't they "fix" them?

     

    It's client side normally. So they could fix it with a patch.

    But any program can have memory leaks really, even a hand calculator can have memory leaks, so it could be server side, but normally it means client side, aka your PC.

    What game is this about?

  • CurraCurra Member UncommonPosts: 34

    Age Of Conan.

  • CurraCurra Member UncommonPosts: 34

    Ok so "the client" is me ( duh! - to me) so is it my internet connection or my computer?

  • WaterlilyWaterlily Member UncommonPosts: 3,105

    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

    Use this if you want to check for memory leaks.

    I haven't played AoC a lot, but any memory can be fixed by a patch of the game normally.

  • megaflux19megaflux19 Member Posts: 99

    pfft, taste the barbarian meat sword, and know it well. seriously i dont know why you all dont just change your mmorpg.com tags to "sucker001-sucker999999999".

    you got the buisness now walk away silently or everyone will KNOW you got bent barbarian style.

  • WaterlilyWaterlily Member UncommonPosts: 3,105
    Originally posted by curra


    Ok so "the client" is me ( duh! - to me) so is it my internet connection or my computer?

     

    It's your computer. But it's the software's fault though.

    Memory leaks occur when a program asks for RAM, but doesn't tell window or the OS that it can Release it again.

    Memory from the Ram Heap is requested by the program but it also has to tell window to release it so it's freed up again, if the code doesn't do proper Memory releases it will eventually run out of Ram Heap to use and slow or crash. That's called a memory leak, because it's leaking memory that's doesn't become free again unless you reboot.

    That's also the reason some programs slow down your computer after a while.

  • Kevyne-ShandrisKevyne-Shandris Member UncommonPosts: 2,077
    Originally posted by Waterlily

    Originally posted by curra


    Ok so "the client" is me ( duh! - to me) so is it my internet connection or my computer?

     

    It's your computer. But it's the software's fault though.

    Memory leaks occur when a program asks for RAM, but doesn't tell window or the OS that it can Release it again.

    Memory from the Ram Heap is requested by the program but it also has to tell window to release it so it's freed up again, if the code doesn't do proper Memory releases it will eventually run out of Ram Heap to use and slow or crash. That's called a memory leak, because it's leaking memory that's doesn't become free again unless you reboot.

    That's also the reason some programs slow down your computer after a while.



     

    And that occurs, when the code isn't thoroughly tested and debugged -- i.e.,  the programmer(s) didn't put in the proper strings to release the memory after use. Proper memory management 101.

    This is why so many folks love Python (so easy to SEE missing strings). But unfortunately, C++ is much more efficient in gaming. Downside is this problem, as C++ code is as ugly as it comes and often easy to overlook for missing strings to clean the garbage.

    These game engines aren't getting any smaller. And the lazyness of Visual Basic ensures more garbage in games.

  • WaterlilyWaterlily Member UncommonPosts: 3,105

    nm, off topic too much lol

  • Flyte27Flyte27 Member RarePosts: 4,574
    Originally posted by UNATCOII

    Originally posted by Waterlily

    Originally posted by curra


    Ok so "the client" is me ( duh! - to me) so is it my internet connection or my computer?

     

    It's your computer. But it's the software's fault though.

    Memory leaks occur when a program asks for RAM, but doesn't tell window or the OS that it can Release it again.

    Memory from the Ram Heap is requested by the program but it also has to tell window to release it so it's freed up again, if the code doesn't do proper Memory releases it will eventually run out of Ram Heap to use and slow or crash. That's called a memory leak, because it's leaking memory that's doesn't become free again unless you reboot.

    That's also the reason some programs slow down your computer after a while.



     

    And that occurs, when the code isn't thoroughly tested and debugged -- i.e.,  the programmer(s) didn't put in the proper strings to release the memory after use. Proper memory management 101.

    This is why so many folks love Python (so easy to SEE missing strings). But unfortunately, C++ is much more efficient in gaming. Downside is this problem, as C++ code is as ugly as it comes and often easy to overlook for missing strings to clean the garbage.

    These game engines aren't getting any smaller. And the lazyness of Visual Basic ensures more garbage in games.



     

    Aye and C++ is one of the few languages that has this issue because it uses pointers and dynamic memory allocaiton.  .NET uses managed memory and takes care of most things for you.  So far I haven't seen many developers using .NET and XNA for games though.  I guess because it is new technology and the performance isn't quite as good as C++. 

    Here is an example of how memory allocation works in C++.

    create space in memory to store an integer value

    int* pHitPoints = new int

    assign to that space in memory

    pHitPoints* = 10

    delete and release the memory taken up so that something else can use it.

    delete pHitPoints

    This is neat because generally every object is otherwise static.  This means it always exits when your program is running.  Using this you can add and delete objects from memory while the program is running.  The problem is if you miss a delete a few times and run out of memory then the program crashes due to lack of memory.

  • Kevyne-ShandrisKevyne-Shandris Member UncommonPosts: 2,077


    Originally posted by Flyte27
    This is neat because generally every object is otherwise static.  This means it always exits when your program is running.  Using this you can add and delete objects from memory while the program is running.  The problem is if you miss a delete a few times and run out of memory then the program crashes due to lack of memory.

    But because of the complex nesting, and the ugliness of the code (no elegance in C++, none, zip, nada!), those pointers can and are omitted. Human eyeballs have to see what's missing as no tool will find everything. Debugging helps, but 5000+ lines of code, and it's a rat's nest to find that ONE missing string/pointer.

    It's why I wish C++ had the utility of Python -- good human readable language (even unlike Java). Stict in formatting, too (one wrong indent, and bye-bye!). That would prevent many of these snafus from the gate -- especially during that final rush to get the game gold.

    If wishes were fishes...oh, well.

  • Flyte27Flyte27 Member RarePosts: 4,574
    Originally posted by UNATCOII


     

    Originally posted by Flyte27

    This is neat because generally every object is otherwise static.  This means it always exits when your program is running.  Using this you can add and delete objects from memory while the program is running.  The problem is if you miss a delete a few times and run out of memory then the program crashes due to lack of memory.


     

    But because of the complex nesting, and the ugliness of the code (no elegance in C++, none, zip, nada!), those pointers can and are omitted. Human eyeballs have to see what's missing as no tool will find everything. Debugging helps, but 5000+ lines of code, and it's a rat's nest to find that ONE missing string/pointer.

    It's why I wish C++ had the utility of Python -- good human readable language (even unlike Java). Stict in formatting, too (one wrong indent, and bye-bye!). That would prevent many of these snafus from the gate -- especially during that final rush to get the game gold.

    If wishes were fishes...oh, well.



     

    I have never used python, but I have heard of it.  I have used C# and XNA though and I find the code a lot cleaner to read and use.  Unfortunately it seems C++ and DirectX is what most game companies are still useing because it's what they are used to and they don't know if other programming langues and graphics API will give them the peroformance they want.  It's to bad as I thnk there wouldn't be as many memory issues using other languages and the code would be a lot easier to modify because it's a lot cleaner and more object oriented.

  • Kevyne-ShandrisKevyne-Shandris Member UncommonPosts: 2,077


    Originally posted by Flyte27
    I have never used python, but I have heard of it.  I have used C# and XNA though and I find the code a lot cleaner read and use.  Unfortunately it seems C++ and DirectX is what most game companies are still useing because it's what they are used to and they don't know if other programming langues and graphics API will give them the peroformance they want.  It's to bad as I thnk there wouldn't be as many memory issues using other languages and the code would be a lot easier to modify because it's a lot cleaner and more object oriented.

    Game companies still employ it in AAA games even. BF2142 still uses it, and Morrowind/Oblivion does, too. It still has it's purpose, but C++ is much more efficient (not as good as Assembly or other pure math languages, depending on the job). C++ is low level and offers game companies that total control of system resources so needed to drive these mega math computations called games, but it's older than dirt and god awful to work with (20 years they claim it takes to make a good C++ programmer). As this thread shows, that low level formatting has it's problems, too. C++ is take it or leave it, when most of the coding doesn't even need that level of control. Python comes in to fill that gap, as it doesn't need that control (yet it doesn't have efficient memory usage that C++ has, so small scripts [and yes, in Python it's called scripts/scripting]).

    Haven't touched .Net, as I'm still going through Python. From Python to C++...and buying stock in Motrin.

    Ack...Love computing too much and it shows. :/

  • Flyte27Flyte27 Member RarePosts: 4,574
    Originally posted by UNATCOII


     

    Originally posted by Flyte27

    I have never used python, but I have heard of it.  I have used C# and XNA though and I find the code a lot cleaner read and use.  Unfortunately it seems C++ and DirectX is what most game companies are still useing because it's what they are used to and they don't know if other programming langues and graphics API will give them the peroformance they want.  It's to bad as I thnk there wouldn't be as many memory issues using other languages and the code would be a lot easier to modify because it's a lot cleaner and more object oriented.


     

    Game companies still employ it in AAA games even. BF2142 still uses it, and Morrowind/Oblivion does, too. It still has it's purpose, but C++ is much more efficient (not as good as Assembly or other pure math languages, depending on the job). C++ is low level and offers game companies that total control of system resources so needed to drive these mega math computations called games, but it's older than dirt and god awful to work with (20 years they claim it takes to make a good C++ programmer). As this thread shows, that low level formatting has it's problems, too. C++ is take it or leave it, when most of the coding doesn't even need that level of control. Python comes in to fill that gap, as it doesn't need that control (yet it doesn't have efficient memory usage that C++ has, so small scripts [and yes, in Python it's called scripts/scripting]).

    Haven't touched .Net, as I'm still going through Python. From Python to C++...and buying stock in Motrin.

    Ack...Love computing too much and it shows. :/



     

    I think the worst part of using C++ to build games in having to use the Win32 API.  It's all written in the C language and I hate looking at it even though it's only a few functions.  It would be some much better if it was written in even C++ as at least there is some object oriented programming in it.  I also dislike header files and function prototypes.  It makes for ugly looking and bloated code IMO.

Sign In or Register to comment.