Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th May 2015 04:08 Edited at: 11th May 2015 04:46
I ve tried to search in the forum but didn't find a solution.

Every time i change "level" of my game, so deleting everything and loading the new stuff, the memory usage of my game increase by around 250 MB, for example:

I am in the main Island, memory usage is around 800 MB, I change level going to another Island, memory usage is around 500 MB, i come back to the main Island, memory usage is now 1050 MB, i travel again to the 2nd Island, memory usage is around 750 MB, I go back to the main Island, CRASH!
A CrashOn file is made in the project folder, but is completely empty.

I really can't understand where is this memory leak, I delete everything before to change Island, I delete objects, images, sprites, animations, static objects, bitmaps, effects, musics, sounds, cameras.

Also i thought that the exe memory limit would be 2 GB and not 1100-1200 MB that is where my game crashes.
(I use Windows 8.1 64 bit)

I also use the flush video memory command, this is the function I use to remove everything:



using flush video memory at the top or bottom of the function doesn't make any difference


I want to add that sometimes the game doesn't actually crash but returns an error saying could not load an image or animation, the error is not Always the same but happens in the moment that the games reach 1100-1200 MB used in RAM, so 1 time is an image, 1 time is another etc.
Nothing is obviously missing as I can move from the main Island to the 2nd Island and back like 2 times before the "crash"
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th May 2015 06:11 Edited at: 11th May 2015 07:24
I think I have found the problem but I do not know how to fix it:

After several tests I have noticed that animations attached to an object are not deleted when deleting the object itself (at least in the bone character I use which is .x format)

Is there a way to remove the animation of a character previously added with "append object" before deleting it?


Edit:

seems that someone else got the same problem with dark gdk:

http://forum.thegamecreators.com/?m=forum_view&t=125396&b=22
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 11th May 2015 12:36
How are you using Append Object? because it adds frames onto the end, and by the look of that GDK post they've put it in a loop which would just keep added frames to it until they run out of memory.

Though it should delete them when the object is deleted. I would need to test this cause I've never used append object.

"Get in the Van!" - Van B
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 11th May 2015 16:34 Edited at: 11th May 2015 16:43
I think I have run into this memory leak in the past and I wrote a DLL to solve it.
I have attached a small project that shows the memory leak in action along with my DLL that solves it.
Run the exe and press the R key to reset and you will see an increase in the GPU memory usage until it crashes.
Then un remark the lines labeled in the code to call the commands from my "memory management DLL" and it fixes the leak.
In this demo the DBPro command that is causing the memory leak is set object effect. There are other DBpro commands that cause the problem as well
but I can't find the list I made. The DLL also contains commands to get the amount of GPU memory used.
There is no help file for this DLL since it only contains a few commands which are self explanatory.
It sounds like your GPU only has 1 GB of ram and once you exceed it you get a crash. It is really important to monitor the amount
of GPU ram which is why I wrote this DLL.

NOTE: The DBPro command "flush video memory" does not do anything because it is an empty function in the DBPro source code.


P.S. The demo needs Matrix1's DLLs to compile. The demo also contains 2 functions. One for a CPU friendly Standby mode fro when the DBpro
is not the active app and one to disable the windows Aero theme on Windows 7 before your app starts.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2015 16:59
Quote: "In this demo the DBPro command that is causing the memory leak is set object effect. There are other DBpro commands that cause the problem as well but I can't find the list I made."


I didn't know about that leak. I hope you find, or can reconstruct, your list. Sounds useful.



Powered by Free Banners
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th May 2015 19:03 Edited at: 11th May 2015 19:27
that's why the flush video memory command does nothing.

About appending I am doing it how it supposed to be used, for example on my main character I do this:



I don't use to write "total object frames(1)+1) so that with a quick view I can check where a specific animation start.


About the Video Memory, I actually have 2 GB (nvidia gt635 m), what it runs out of memory is the system RAM i think and not the video RAM.
Why it cuts the game at 1200 MB aprox of usage (looking on the task manager) is probably because even if it uses that amount of memory, there are some weird peaks of memory usage and then go back to that amount, so maybe is reaching the 2 GB limit? I Am not sure, but even trying a simple test loading like 50-100 objects and deleting them, and back again, the amount of memory used is the same (for example, load and take 200 MB, delete and take 20 MB, reaload and take 200 MB, redelete and again 20 MB and so on), but sometimes I see an higher peak for a second (for example 300 MB) (The test I mean is by using normal objects without appending anything so not affected by memory leak, so I don't know what cause these random peaks memory usage too)

Edit 1: Tried to use "total object frames(1)+1" and changes nothing
Tried to copy the 2 files of your DLL and added the commands



after deleting the objects but changes nothing, this is not how it supposed to be used? maybe is clearing up video memory and I need to clear up just RAM as I was saying? Is the RAM the problem I think, not my total amount of RAM which is 8 GB but the 2 GB limit which are taken very fast as I lose 250 MB of memory each time delete and reaload the next island
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th May 2015 23:31 Edited at: 11th May 2015 23:38
Now that I think better, my laptop is using the intel hd4000 as a graphic card as it seems to perform better than the nvidia, and as it uses RAM as video memory it might be a video ram memory leak as well, I will test the exe with the nvidia card and see what happens.


Edit: even using the nvidia card the game still crashes when it reaches 1200 MB of RAM aprox (looking on the task manager)
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 02:46
Also stab if i try to compile your source I get an error saying:

Runtime error 1507 Display - using 32 bit is not supported by available hardware at line 0
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 03:28 Edited at: 12th May 2015 03:38
Quote: "Runtime error 1507 Display - using 32 bit is not supported by available hardware at line 0 "


This error is caused by the DBpro Compiler. Code gets injected by the DBPro Compiler at the first line of the file to check if the
screen resolutions that are selected in the properties pane in the IDE are valid on your machine. Change the Windowed and Full
screen resolutions in the properties pane. I usually pick say 1024x768, or pick what you know is good for your machine.
Everyone gets confused by this because you do not see the code injected by the compiler.

I use a great program called "Process Hacker" to diagnose how much memory is being used, system ram and video ram.
I actually used some code from Process Hacker to write my command to get the amount of video ram used.
Download from this link.

http://processhacker.sourceforge.net/


DBPro exes are 32bit so you are limited to memory addresses up to 2GB.
There is a hack to force a DBPro exe running on a 64bit OS to use system memory addresses beyond 2GB, and up to 4GB.
Well it is not really a hack since it is actually built into DirectX 9.0c it is just a matter of turning it on for your exe.
I will write a tutorial tomorrow on how to get your exe to access more memory when running on a 64bit OS.

P.S. I forgot how easy it was to fix just download this 4GB patch and run it on your exe.

http://www.ntcore.com/4gb_patch.php

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 03:53 Edited at: 12th May 2015 03:57
I have changed both resolutions to 1024x768 with no luck, I have even restarted the editor, but I get the same error

Btw is that enough to add:

flush= mm_evictmanagedmemory()
mm_released3d_device

after i clear up things?

Because that seems to do nothing, memory on the task manager is still the same.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 15:19
Quote: "I have changed both resolutions to 1024x768 with no luck, I have even restarted the editor, but I get the same error"


Change it to what works in your other DBPro projects.
The error is not caused by the code or DLL.

Quote: "Btw is that enough to add:

flush= mm_evictmanagedmemory()
mm_released3d_device

after i clear up things?"


YES,This will only clear GPU ram if it is not being released.
Did you use the command "mm_gpumemoryused" to check if you are exceeding the GPU ram?

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 15:42
that is the resolution I use in my game project, So I don't know why it doesn't work, 1024x768 it's a resolution I use in most games as well, it is supported for sure.

I didn't check that command but I ve tested mm_gpuavailablememory() and it Always show 32768 as a value which is weird, like is locked to that amount
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 15:58
Delete the .dbpro file and create a new project with the .dba file, it might be a corrupted project file.
mm_gpuavailablememory() returns the total available GPU memory, you need to subtract from it the mm_gpumemoryused() each loop.
Study the code example.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 16:00
That is weird too, if is intended as KB that would be just 32 MB of total video memory? weird
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 16:40
Yes, mm_gpuavailablememory() returns kb but you can divide by 1024 to get mb.
Not sure why you are getting such a small number.
Have you run Process Hacker to see what results you get for system and video ram.
I probably should have named the command mm_gpuTotalMemory() instead of mm_gpuavailablememory since it
only returns a static value of gpu ram. It is important to monitor the video ram being used because if you exceed the video ram
it will crash. Have you tried the 4GB patch on your exe to see if that helps?

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 17:16
I didn't tried these programs, but I will add the 4 GB patch to the final exe just to make the "crash limit" higher.

I think I have just finished now to manage a workaround of my problem.

What I do now, is load the .x model and append all the animation data with the "append object" command, then save that object to .dbo. (not ingame but with a few lines I wrote in a different project). So now the characters I load ingame are .dbo and not .x.


I was surprised when I have made this test because in the past I couldn't get the .dbo format to work with bones animation models, and i thought I should only use the .x format for them.

With this workaround there are pros and cons:

Pros:

- Drastically reduced loading time (the main Island was loading in like 25 seconds and now it loads in just 6 seconds)
- Good amount of RAM saved, when everything is loaded in the main Island, the game takes now around 620 MB instead of 820 MB
- Memory leak due to append object command fixed, I have tried to go to the 2nd Island and back several times and the amount of memory used was aproximately the same, even if there are some little memory leaks elsewhere they do not compromise anything as if there are some memory lost is very little

Cons:

- Much higher data on the game folder, .dbo objects takes way more memory in the hardisk compared to the .x models, also, I used a trick to lower each .x animation file by 90% (around 100 Kb each instead of 1 MB) by reducing the meshes of the characters to 3-4 vertex each (only for the animation appended, not the main model which must be with full info), and with this workaround the memory saved on the game folder is lost.
Also I used to share some animation files for different characters, so the space on the game folder gains more for this too because they need to be added on each character using it to create the .dbo file

- Trickier object Handling, if I need to change something on the model or add some animation I have to redo again the conversion with the little program I wrote, to do this I still have to keep saved somewhere the single animation files.
Also, I was thinking of making 3 mesh level detail for the characters, if I have to do this again, other than wasting more time doing that, I will higher again a lot the space taken in the game folder, because instead of loading the high/med/low detail character, and then add the animation, I should have 3 different .dbo files with everything inside


Testing my game with these changes seems everything ok except for a crash i get when i get close to a character (exactly when the LOD changes), There must be something wrong in that object because all the other LODs are working fine, I remember some time ago I had a similar problem that was crashing my game when I was getting close to the LOD distance of another object, my next work will be to fix this
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th May 2015 17:34 Edited at: 12th May 2015 17:55
Stab in the Dark Software

I'm having problems compiling your memory leak demo as well. The first problem was the same unsupported display mode error discussed above - that was easily fixed by changing the initial display mode in the Properties panel (as you advised earlier).

However, with that out of the way I then got the previously discussed error "Constant declaration for 'TRUE' duplicated". That error remains whatever I call the constant - e.g. see attached screenshot and its output window. What on earth is going on? I very doubt any Plugin has a variable or constant with that name.

I'll try recompiling from a fresh project and will report back.

EditYep that did the trick. Just had a look at the dbpro file (after loading the project into the default Synergy editor) and I see the whole code is duplicated!



With those two changes everything works as intended (as far as I can tell).



Powered by Free Banners

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 17:45 Edited at: 12th May 2015 17:47
I Checked the DBPro source code and it seems that when you call "append object" the object that you are
appending gets loaded into memory but never gets deleted. Since you do not have an object number for it you can not
delete it. Definitely a bug in DBPro, the only way to fix it would be to rebuild the DBpro source code but then you would be using
a custom version of DBPro. Your solution looks like a good work around.

Green Gandalf
Just change true everywhere it's used. I think it's the Extends plugin that has a declaration of TRUE & FALSE.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th May 2015 17:58
Quote: "Just change true everywhere it's used. I think it's the Extends plugin that has a declaration of TRUE & FALSE."


Look at my screenshot - and my edit!!!

Nothing to do with plugins at all - it's an obscure incompatibility between your editor and the default synergy one.



Powered by Free Banners
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th May 2015 18:08
Yes, I had created that project file with an older version of my IDE. I forgot to check it in synergy.
If anybody else is using the demo just delete the .dbpo file and create a new project.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th May 2015 18:10
Ah, that explains it. Thanks. The memory leak looks quite dramatic. I wonder if that affects Dark Shader?



Powered by Free Banners
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 12th May 2015 20:56
Fixed the LOD crash problem, main object and LOD object were mismatching limbs order, finally I can go forward with my game
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd May 2015 04:23
Hey stab, the plugin works great in win 7 but I get an immediate crash with the error 'cannot find application entry point something something in d3d9.DLL' when using it on win XP

mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 8th Jun 2015 00:24 Edited at: 8th Jun 2015 00:36
Stab in the Dark software
Quote: "In this demo the DBPro command that is causing the memory leak is set object effect. There are other DBpro commands that cause the problem as well"

I thought I will never post on TGC again, but your charge of memory leak has interested me enough to check your example.

1. Example is awful piece of code.
2. Because of 1) it has memory leak.
3. I rewrote your crap and made a "level reset" for a thousand times with no memory leak.

set object effect is 100% okay.

Now I shall return to my den.

P.S. append leak doesn't bother me as it is not critical and can be avoided.

Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 8th Jun 2015 02:41 Edited at: 8th Jun 2015 02:52
mr Handy

Can you prove this with a code example?
With out proof no one will take you seriously.

It seems that these forums are plagued with TROLLS and FLAMERS.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 8th Jun 2015 07:37
Quote: "It seems that these forums are plagued with TROLLS and FLAMERS."

Indeed.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 8th Jun 2015 09:53
I have had issues with Mr. Handy in the past.

Accusations of trolling aside, what he has said has some merit.

This is an important point that I will make concerning DB Pro. If you are deleting things you need to delete them in the correct order or you can encounter glitches, errors, or even unpredictable behavior.

Make sure you delete Animations before Sprites and Images. Delete Sprites before Images. Delete Images last. Delete effects before Objects, etc.

In short:
Do not delete assets when other assets are still referencing them.
Otherwise DBPro can and will miss things.

A lot of problems are cleared up when code is properly organized.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2015 12:26
Quote: "mr Handy

Can you prove this with a code example?"


I agree. Please give us enough details to understand what the problem is. It would be useful to know whether the problem is simply caused by doing things in the wrong order as suggested by Mage which certainly sounds plausible. If that's the case then we should be able to reproduce the problem without resorting to external plug-ins and DLLs. In other words a simple demo using native DBPro should suffice.



Powered by Free Banners
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 8th Jun 2015 16:32
Green Gandalf

You are the only nice guy here, so this is for you:



because



Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 8th Jun 2015 16:35
Quote: "what he has said has some merit"


What he said has no merit with out proof.

Quote: "If you are deleting things you need to delete them in the correct order or you can encounter glitches, errors, or even unpredictable behavior."


The example does not suffer from this issue.
I have been using Dark Basic a very long time and I have never heard of this issue in DBPro. Could you provide a code example?

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 8th Jun 2015 16:50
mr Handy

You should have studied the code a little more.
You are not calling "set display mode" and you excluded the code to
monitor the GPU ram being used.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2015 20:47
Quote: "You are not calling "set display mode" and you excluded the code to monitor the GPU ram being used."


Why are those needed? Memory leaks usually show up in Task Manager. Precisely which commands - or sequence of commands - cause the leak? It wasn't immediately clear from your original snippet.

mr Handy

Thanks for the snippet.

What's the point of these two lines?



I thought those commands were only relevant if you've used the companion commands





Powered by Free Banners
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jun 2015 21:19 Edited at: 8th Jun 2015 21:21
Sorry for double post but I've just tested mr Handy's extremely useful snippet.

His method runs without a leak as he says - but only if you use the apparently unnecessary set vertex shader off and set pixel shader off commands. If you comment out those two lines then the leak is very obvious in Task Manager - and also shows when I use my previously favourite way of clearing a shader (i.e. texture object objID, imageID).

His snippet also confirms what Mage was saying - that if you delete things in the right way then problems don't arise. That may be true but how does the casual user know what needs deleting or the best way to do it? I don't think I'm a casual user and this is the first occasion I've seen a need for those two set shader commands.

So, summarising all this, I think everyone is right:

- mr Handy is correct to say there is no problem - but only if you follow Mage's advice and do things the right way
- Mage is right to suggest you need to do things right
- Stab in the Dark software is right to suggest there's a problem if you do things the obvious way (as I have done in the past).


Stab in the Dark software

This still leaves the question of what you think is wrong with mr Handy's snippet - which, with trivial changes, shows both the problem and a solution along the lines I requested.

Have I missed something?

Here's the version of mr Handy's code which I used:





Powered by Free Banners
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 8th Jun 2015 22:53
Quote: "Why are those needed? Memory leaks usually show up in Task Manager"


The code to monitor the GPU memory usage is very useful if you want to monitor it in a game engine editor.
I developed this code while helping Lee because he needed it for FPSC Reloaded/GG editor.

Quote: "His snippet also confirms what Mage was saying - that if you delete things in the right way then problems don't arise"


I still do not see anything to prove order of deletion solving this leak, which as you said is unheard of in DBPro.


Quote: "This still leaves the question of what you think is wrong with mr Handy's snippet - which, with trivial changes, shows both the problem and a solution along the lines I requested."



Try adding the 2 commands that Mr Handy suggested to my original code where I call "Set Display Mode" in the reset
it will crash. The point is that if you are handling a lost device or a reset and you call "Set Display Mode" it has a memory leak.
Why is everyone omitting "Set Display Mode"?
From looking at the DBPro Source code "Set Object Effect" is the culprit.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 00:45
Quote: "Why is everyone omitting "Set Display Mode"?"


Because you keep saying:

Quote: "From looking at the DBPro Source code "Set Object Effect" is the culprit."




What's the relevance of set display mode?





Powered by Free Banners
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Jun 2015 01:12
Green Gandalf
Quote: "Why are those needed?"

Junk code that also used extremely wrong.

The code for memory management is useless because there are professional programs like Microsoft's Process Explorer. You should try it, it is portable and free.

Quote: "Precisely which commands - or sequence of commands - cause the leak?"

Delete object. For sure.

I looked through the DBP source code but did not found the code for cleaning on object deletion.

Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th Jun 2015 01:39
Green Gandalf
When handling a lost device you would want to use "Set Display Mode".
You might want to change the display mode like most modern game engines do without restarting the exe.
This would require calling set display mode in the reset.
Calling Set Display mode is supposed to wipe the graphics card memory but does not have access to the
memory allocated by the "Set Object Effect".

Mr Handy
Quote: "Junk code that also used extremely wrong.
The code for memory management is useless because there are professional programs like Microsoft's Process Explorer.
You should try it, it is portable and free."


Like you would know spending most of your time in Geek culture.
A good game engine needs the info and does not want process explorer running at the same time.

Quote: "Delete object. For sure.
I looked through the DBP source code but did not found the code for cleaning on object deletion."

That is not true and I doubt that you would even know how to read the code never mine understand it.
You have a reputation for trolling and flaming, why are you even still here.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Jun 2015 01:47 Edited at: 9th Jun 2015 01:49
This has gone too far. I want to call the mods.

* Personal attacks directed specifically at you
* Comments putting down your work, for no obvious reason, in an aggressive way
* Forum Harassment - someone constantly slagging you off, regardless of thread

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 02:01
Stab in the Dark software
Quote: "
Calling Set Display mode is supposed to wipe the graphics card memory but does not have access to the memory allocated by the "Set Object Effect"."


Ah, I see. Shame you didn't explain that earlier since it is highly relevant.

I see what you mean about the crash when you try to use the two set shader off commands before set display mode. No crash occurs unless you change the mode. It seems to me that alone points to set display mode being the issue - although it's hard to tell since these commands are all linked behind the scenes in some way because of the data they are respectively creating/sharing/deleting.

Anyway, whatever the precise cause, something is clearly wrong somewhere - and I think the leak highlighted by my version of mr Handy's code seems like a different one from the one you describe (for example, your leak is much greater).

Aside

Quote: "Junk code that also used extremely wrong."


Quote: "That is not true and I doubt that you would even know how to read the code never mine understand it.
You have a reputation for trolling and flaming, why are you even still here."


I don't think there's any need for those kinds of remark here. Why not simply address the issues?



Powered by Free Banners
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th Jun 2015 02:01
You started it with the abusive attitude in your first post.
Mr Handy
Sometimes it is better to thought a fool then open your mouth and remove all doubt.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 02:08
Quote: "You started it with the abusive attitude in your first post."


True enough - but it could have ended there if you hadn't responded in kind. Think about it.

Good night.



Powered by Free Banners
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 14:33
I've just had another look at your demo and the crash and major leak both disappear when I comment out your "mm" functions. I also needed to do this:



It also works if I uncomment my if/endif commands.

I'm not sure where the problem lies exactly, but your DLL is implicated as are your existence checks. Perhaps you ought to take mr Handy's comments more seriously instead of adopting a knee-jerk abusive stance?

You've done good work here on the forums, please don't spoil it by being unnecessarily rude to people.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Jun 2015 20:58 Edited at: 9th Jun 2015 21:08
Props to mr Handy. This discussion was starting to worry me. Setting or changing the display mode will free video memory (appended animations not tested). However, if an effect has been applied to an object, Set Pixel Shader Off and Set Vertex Shader Off need to be called on the object.



Edit: rem the call to cleanup and see how fast it crashes.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th Jun 2015 21:10
I see there is still a mystery as to why you would call "Set Display Mode".
When making a game engine you would want to be able to handle lost device.
Enough said about lost device everyone can research it on the forums and learn why you need to handle lost device.
In your game engine you would want to have a settings GUI which would allow the user to change screen resolutions
without shutting down the game, changing settings in a config file and starting the game back up.
Calling "Set Display Mode" while your exe is running causes a lost device which you have to handle.

I do not understand why people with a knee-jerk abusive reputation are excused while
others who have actually done something constructive in DBPro are criticized the minute the push back after
their patience has been tested. Mage commented that he had problems with Mr Handy in the past.
I have been using DBPro since 2000, been on the forums since 2002. I have written several dlls including the
ragdoll physics used in Game Guru. I will not be abused by people who do not know what they are doing.
I am more than willing to help others learn what I know that is why I wrote this dll and am providing it free
to help with a problem I can prove exists. For him to post the code is crap or junk without first explaining and proving
his point is Flamming.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 21:16
Quote: "I see there is still a mystery as to why you would call "Set Display Mode"."


No - the mystery is: why does your implementation cause a crash?

Quote: "I do not understand why people with a knee-jerk abusive reputation are excused"


No-one is excusing you - or mr Handy for that matter. Just get over it please.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Jun 2015 21:37
Quote: "No-one is excusing you - or mr Handy for that matter. Just get over it please."

Agree.

@ Stab in the Dark software:

Is this what you mean. Extract the attached download into you GPULeak project folder. Run the program then Win-L to lock your computer. Log back and press the space key to change display mode. Now, lock the computer again and log on.

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th Jun 2015 21:55
What are you trying to prove with that exe?

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 9th Jun 2015 22:08
To WickedX, when I was trying to fix the memory leak if I am not wrong I have tested the set display mode command to free the memory used by appending the animations, without success, so it doesn't fix the leak, perhaps they are stored in the RAM?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jun 2015 23:13
Quote: "Run the program then Win-L to lock your computer. Log back and press the space key to change display mode. Now, lock the computer again and log on."


Brilliant! I didn't know you could do that. More to the point, how did you do that?

Quote: "What are you trying to prove with that exe?"


That was my thought (= knee jerk reaction ) when I read the post. Soon changed my mind when I followed the instructions. Did you try?



Powered by Free Banners
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th Jun 2015 23:27
Yes, but what is the point I already know how to handle a lost device. Is it demonstrating that there is no memory leak?
Where is the explanation of what the exe proves.

WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-05-08 19:25:07
Your offset time is: 2024-05-08 19:25:07