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
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:51
Quote: "Yes, but what is the point "


It was a simple question - and deserved a simple answer.

When you run the demo you get a massive memory leak (as in your demo) when you log out and in again - but you also still have your media showing. When you change display mode you still get the massive leak. You don't get a crash with either method. So the next step for WickedX is to show how to get rid of the leak without your rigmarole. My guess is that the answer to WickedX's question is "Yes" - in which case I guess he'll move on to the next step.

But I am purely making educated guesses at WickedX's line of thinking.



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

A quick last comment.

A "lost device" event happens when you are playing the game and:
- locking Windows
- putting Windows into sleep mode
- starting the screen saver
It should cause game crash.

I have never meet people that do one of those crazy things when playing fullscreen games!

Note: minimizing the game to read online walkthrough is safe.

Also will you write a background function to check:
- if the player during play will delete game resources?!
- if the player tries to hack the game memory to gain gold or health and suddenly writes 10000 to wrong memory allocation?!
- if player press alt+f4 and the game does not wiped some temp data?!
Why not, I did those things.

Philosophy: the game does not need functions to handle improper use of the game, it is the user's responsibility.

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 00:25 Edited at: 10th Jun 2015 01:56
@Cescano:
I really didn't think it would work for appended animations. The suggestion I would have is to apply the animations in a modeling program.

@Stab in the Dark software:
I now think I get what you're saying.

This snippet will change the display mode in the loop and recover from lost device at the same time. Normally we wouldn't be changing the display mode constantly in the loop like this. I let the program run for an hour and no crash. So, I don't think there's a leak.

You will need the surprisingly simple device lost functions from my Plug-In to compile this. Plug-In source code also available in thread.
]http://forum.thegamecreators.com/?m=forum_view&t=213811&b=18

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2015 00:26
Quote: "I have never meet people that do one of those crazy things when playing fullscreen games!"


Then you have limited experience of life's exigencies.

Scenario:

Parent playing game while child playing with their toys. Parent suddenly hears a choking sound from child. Does parent carefully close down game and PC or does parent go immediately to the child's aid returning to the game some considerable time later perhaps?

Why add to the parent's misery by having inadequate media recovery?

With a bit of thought I'm sure you're capable of thinking other, less drastic but equally realistic, scenarios.

Quote: "Philosophy: the game does not need functions to handle improper use of the game, it is the user's responsibility."


Now you are being silly.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 00:47 Edited at: 10th Jun 2015 00:48
There does seem to be about a 5-10mb leak every time the device resets. Took about 20 resets to go from 20mb to 100mb. What to do about this. I feel I'm back to square one. May have to give up DBPro and Dark GDK altogether.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2015 01:19
WickedX

I couldn't get your code to compile. The editor finds the correct syntax from the .ini file but the compiler throws an error: Could not determine parameter type. This happens for the two functions device lost() and device reset(). It's as if those two functions are not in the DLL.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 01:48 Edited at: 10th Jun 2015 02:02
That is odd. I just compiled with the dll from the download. Stupid question, are you sure you copied the dll to the correct folder?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2015 02:48 Edited at: 10th Jun 2015 02:49
Quote: "Stupid question, are you sure you copied the dll to the correct folder?"


Not stupid at all - it was the first thing I checked. Screenshot:





Powered by Free Banners

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: 10th Jun 2015 03:05
Found the problem. Your DLL conflicts with IanM's Matrix1 plug-ins. When I moved his DLLs out of the way then your code compiled and ran fine.

I don't see a memory leak with that demo - nothing noticeable anyway.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 03:15
Cool! Yeah, noticed you had the Matrix1util Plug-In installed, was going to suggest that.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2015 03:23
Quote: "I don't see a memory leak with that demo - nothing noticeable anyway."


Sorry. I do see a memory leak when I do your log out/in thing. I don't see a leak in standard running without interruption.

[Getting tired. It's late here and time I was in bed. In fact dawn isn't that far away now. ]



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 03:30
Good night. I am little tired myself. Glad to hear you're not experiencing a leak. Maybe the DBPro version I'm using (7.4).
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jun 2015 11:55
Quote: "Glad to hear you're not experiencing a leak."


Under which circumstances do you see the leak? When you simply leave the program running or when you log out/log in? I see it under the latter.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Jun 2015 23:08
Sorry, misread your post. The leak happens with logoff/logon. If you remark this line, no more leak.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2015 01:01
Which seems to be what Stab in the Dark software was essentially saying at the outset.

Incidentally, your demo crashes from time to time when I use log out/in. Usually after two or three such attempts and never just after the first - and it's the usual DBPro stopped working message.



Powered by Free Banners
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Jun 2015 05:34
Quote: "Which seems to be what Stab in the Dark software was essentially saying at the outset."


I agree, took me awhile to grasp that point.

I get 100% success with the device lost functions in the Plug-In on Windows 7 and 8.1. I use the internal callback functions which may be a little flaky in how they work with syncing and the render cycle.

The attached dll uses the device lost method I use in Dark GDK. This dll make the function Device Reset obsolete and requires modification to the code. Let me know how this works out, Please! Looking into what could be causing the leak.

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: 11th Jun 2015 17:33
This is why I made the command "mm_evictmanagedmemory()" because the "flush video memory" command in DBPro does not
do anything because the code was removed from the function. You would want to monitor the amount of video memory used
because as the demo shows when you use up all the video ram your game will crash. When changing levels in a game you would
want to clear all video ram. Lee monitors the video ram used in GG to prevent exceeding the video ram.
I felt this is the easiest way to solve this rather than altering the DBPro source code.

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.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Jun 2015 21:07
good info here guys.

Stab in the Dark,

did you see my post about your dll commands crashing on windows XP?

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 Jun 2015 21:14
Quote: "
did you see my post about your dll commands crashing on windows XP?"


Yes, I do not have XP to test on anymore.
Not sure why it would crash on XP maybe its not related to XP.

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.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Jun 2015 21:33
maybe. its the same code, same version of dbpro, and same version of directx on both machines. if it is not an OS issue, I suppose it might be hardware or driver issue. the XP machine is a laptop with basic integrated graphics, but it doesn't have any trouble running the code without the dll commands being called.

I don't care too much and am not looking for a fix, but thought I'd make you aware of the issue.

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Jun 2015 22:21
I just tried your download and Plug-In and I get the generic error - "A problem caused the program to stop working correctly", with Windows 8.1. I can use the functions from your Plug-In in the source I'm using without an issue. The two functions mm_evictmanagedmemory() and mm_released3d_device do make mr Handy's Set Shader Off calls unnecessary. However, there's something with Set Object Effect that's causing system memory to not be freed on a device reset. Since I can't run your code I have to ask, does your code recover from device lost without the leak?

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: 13th Jun 2015 03:05
Quote: "I just tried your download and Plug-In and I get the generic error - "A problem caused the program to stop working correctly", with Windows 8.1."


The demo project .DBPro file was created by my own IDE.
The Synergy IDE has a issue with reading the .DBPro file created by my IDE because
it is case sensitive. Just delete the .DBPro file and create your own project file and it should work.
I do not believe that it has anything to do with Windows 8.1.

Quote: "I can't run your code I have to ask, does your code recover from device lost without the leak?"


Yes it does recover with out the leak.
It also goes into standbye mode using the call back to the function.

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.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Jun 2015 09:24
Cool! I don't think win 8.1 is the issue either and it compiles so, I don't think it's the IDE. I do not use Synergy IDE. In my snippet above if the device is lost, it just loops in the Plug-In until it has been restored. I still get the leak. I really don't get why it occurs only with Set Object Effect.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Jun 2015 05:06
What about the command Flush Video Memory?

Shame System Dmem Available() is broken on modern systems... does it work for anybody else?

James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 14th Jun 2015 06:04
Quote: "What about the command Flush Video Memory?"

Quote: ""flush video memory" command in DBPro does not
do anything because the code was removed from the function"


Quote: "Shame System Dmem Available() is broken on modern systems... does it work for anybody else?"

Even on older hardware it was very slow, tried it on 3 machines in the past and it took ages to report so not something you could call every frame or even every so many seconds apart(besides different hardware gave me different times), it only ever told me how much VRAM was on the card, not the amount in use or free. Says as much in the help file.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 14th Jun 2015 08:02
James H Hmm, I need sleep...

I must agree DBPro drastically needs a working threading system of sorts and that should make it viable into the next decade at least...

Time for that kip... maybe...

Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 14th Jun 2015 13:09
Quote: "
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?"


I just came back here to see all this talk, and replies.

I was only speaking to the general principle of writing clear orderly code. Doing things efficiently and in the proper order. The Original Post only contains a small snippet of code from a game. If I saw something specific in the snippet I would have posted it.

Also the merit of Mr. Handy's original post I mentioned was merely his support for clear and orderly code.

Login to post a reply

Server time is: 2024-05-20 02:12:18
Your offset time is: 2024-05-20 02:12:18