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.

DarkBASIC Professional Discussion / programs crashing after extended length of use

Author
Message
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 26th Aug 2011 08:04
When leaving a dbp program running for 6-8 hours at a time it stops processing. This may just be to computer being stupid but it also may be a dbp thing. Any thoughts?

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Aug 2011 11:25
You need to do some analysis of your program. I did something similar here with some timing issues I had. You should be able to track it down to some code somewhere, doing something you didn't expect it to do.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th Aug 2011 11:30
It is probably a memory problem of some sort. Exit is a command that can use memory gradually. Each Gosub stores a return, and Exit can cause the return stack to build up. I suppose you should go through your code, and try to figure out what else might be causing memory to be dropping down.

Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 26th Aug 2011 14:15
What about exit when used in loops?



Would this eventually use loads of memory gradually as described?
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th Aug 2011 14:21
Some loops use memory, But I think a Do Loop doesn't store anything so is OK.

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 26th Aug 2011 15:03
I'm sure not so long ago I came across a 'Flush' command which does a garbage collection. Just had a look through the manual but can't find anything.

I'm always suspicious of DBPro strings too whether they're always sitting around after being used.

Warning! May contain Nuts!
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 26th Aug 2011 17:03
Loops don't use the stack, so exiting them via 'EXIT' doesn't won't leave any bread crumbs. Forgetting to RETURN from a Gosub sure will though.

Quote: "
I'm always suspicious of DBPro strings too whether they're always sitting around after being used.
"


From memory, there was (and perhaps still is) an issue when deleting types that had strings in it. So that might worth investigating.

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Aug 2011 17:21
The string issue was resolved about 12-18 months ago, if you're on an up to date release this will be fine. If you're not up to date and can't update for any reason, you can resolve this issue with CLEAR STRING$()

tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Aug 2011 18:18
Any number of problems can occur. What does Task Manager show for the process after 3-4 hours? More memory being used?


A 3D marble platformer using Newton physics.
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 26th Aug 2011 18:27
Thanks for the replys! My program doesn't use exit exept when the program is cloesd.
I will keep an eye on the task manager and I will make a debug version, thanks!

SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 27th Aug 2011 00:08
After some time the program stops printing text to its window, no error no not responding any ideas?

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Aug 2011 00:47
Are you using Sync On, then later Sync?

Mugen Wizardry
User Banned
Posted: 27th Aug 2011 01:02
If I were you, I would have it autosave every 30 mins. No matter if it's a game or what, then if it goes for 40 mins, tell it to close.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 27th Aug 2011 02:35 Edited at: 27th Aug 2011 02:36
[mistake double-post edit]

SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 27th Aug 2011 02:35
no i'm not using sync. I can not save because this has no data to save it is realtime and must stay running at least 10 hours

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Aug 2011 02:50 Edited at: 27th Aug 2011 02:53
Well, sync on, and sync might fix your problem, so you could try that. Put sync on at the beginning of your program, then maybe choose a sync speed like sync rate 60, or 0 if you want full speed. Then you have your Do Loop..

Line 1... Set Display mode..etc
Line 2... Sync On: Sync rate 60

Do


Sync
Loop

Put the sync at the end of the loop.

Mugen Wizardry
User Banned
Posted: 27th Aug 2011 03:02
NEVER use 0 for sync. while that causes full speed, it also causes MANY problems. you're gonna wanna use:

sync on : sync rate 60
set display mode 800, 600, 0, 1

Do
sync
loop

also, use timer based movement, and multiply ALL the speeds of your objects or camera in your game by the timer based factor, so no matter HOW crappy the PC is, it will still be extremely fast

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Aug 2011 03:33 Edited at: 27th Aug 2011 03:36
You can use sync 0 for things that you want to be fast. DB Pro isn't just about games. Maybe it's being used for complex physics.

SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 27th Aug 2011 03:34
so far so good thanks for the sync on tip

Mugen Wizardry
User Banned
Posted: 27th Aug 2011 03:43
yes, but even with COMPLEX physics, there are objects that take up memory. Even 1 sphere can take alot of memory if u dont sync it right

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 27th Aug 2011 03:46 Edited at: 27th Aug 2011 03:46
im not using 3d at all plus my sync is set to 10 so no worries

Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Aug 2011 06:03
Rather than have the community guess what you're doing, why not tell us ? Even better, post some examples.

With issues like this, it's useful to log the state of that application while it's running. So knock up some code that runs through and gives you a run down of what the internal state is at any given time.

The log could show the state of arrays & lists, and if you're dealing with resources, it could show the state of the particular media (number of created materials, etc etc), the more info the better. So when it dies you can look back at the log and hopefully notice where some inconsistency occurs.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 27th Aug 2011 06:20
Quote: "Even 1 sphere can take alot of memory if u dont sync it right"


The sphere will use the same amount of memory regardless of how many times you render it.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Aug 2011 16:47
Sync 0 is not the same as don't sync. Sync 0 means sync as fast as possible.

Sync does not mean put a sphere in memory. It means, update the screen, and screen flip with whatever changes have been made.

Login to post a reply

Server time is: 2026-07-10 20:58:01
Your offset time is: 2026-07-10 20:58:01