Code to check what is Not cleared out of memory

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Code to check what is Not cleared out of memory

Post by chris25 » Fri Nov 01, 2013 1:29 pm

I culled the following from the website below as a result of Livecode quitting and locking me out of my mac for about the 5th time in two weeks. Having to restart from the boot-up disc each time because I can not shut down the mac. I had already set the preferences - memory in livecode to destroy stack on close, and had ticked the box where it asks you every time whether to destroy stack as an extra precaution. I also check the app/proj browser to make sure that it is empty. Nevertheless it has caught me out on a number of occasions and upon eventually re-starting from boot-up the recovered files are sometimes littered with png's, a few other known stacks, and even once two stacks that are not even in any of my folders - believe me I know what should be there - that was a surprise. So after searching I found this code. The trouble is I actually do not know how to use it. The site is obviously for the professional and assumes you know what to do - which I unfortunately don't. Thankyou gentlemen. As a side note there does seem to be consistency in livecode's unwelcome behaviour: I notice that this happens when I have been working on a single stack but have been constantly accessing other stacks to see their code, and shutting them down after just a few minutes, it seems to me that livecode resents me viewing multiple stacks over a period of hours.

http://revolution.screenstepslive.com/s ... -in-memory


function StacksInMemory
local theStack,theStacksInMemory,theSubstack

repeat for each line theStack in the mainstacks
put theStack & cr after theStacksInMemory

repeat for each line theSubstack in the substacks of stack theStack
put theSubstack & cr after theStacksInMemory
end repeat
end repeat
delete the last char of theStacksInMemory
return theStacksinMemory
end StacksInMemory

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Code to check what is Not cleared out of memory

Post by Klaus » Fri Nov 01, 2013 1:38 pm

Hi Chris,
but have been constantly accessing other stacks to see their code, and shutting them down after just a few minutes,
please post your script(s) for this!
Maybe we can sort this out somehow.


Best

Klaus

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Code to check what is Not cleared out of memory

Post by chris25 » Fri Nov 01, 2013 11:22 pm

Hi Klaus, firstly that is impossible, it is not my scripts, since I hardly write that much. I mostly debug and watch what happens. Also, my scripts are so basic that it is embarrassing, No, it is the opening and closing of many stacks that causes the problems. I don't think sending you scripts will reveal anything.
Sorry Klaus.

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Code to check what is Not cleared out of memory

Post by chris25 » Sat Nov 02, 2013 10:47 am

Klaus, this is another example where stacks that I have no knowledge about are being loaded into memory and Not Cleared Out upon Livecode quitting - This is the Major and Only source of the problem. This time luckily, I had re-started the mac, something I don't need to do or usually do except once a week. And here are the recovered files, this recovered folder is what the mac had to pull out of memory and ask whether or not you want it permanentlyy deleted. So as far as I can make out, either the snow leopard has a little issue with Livecode, or Livecode has an issue. I have to emphasize here that I did not import or load these stacks knowingly, but even so, it happens sometimes with stacks that I do have. Livecode is not removing some things from memory upon quitting despite those preferences being ticked. (not griping here ok, just explaining the facts - this is not a moan at livecode ok).

Kind regards
chris

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Code to check what is Not cleared out of memory

Post by Klaus » Sat Nov 02, 2013 12:18 pm

Aha, OK.
Well, I never had these problems in the last 14 years with Livecode!?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Code to check what is Not cleared out of memory

Post by jacque » Sat Nov 02, 2013 7:31 pm

I've never seen the problem either, and I'm working on a project right now that opens and closes dozens of stacks. I don't recognize some of those Rev files, so presumably they are ones you downloaded to examine. I suspect one of those may be doing something that causes the problem. My main development machine is also running Snow Leopard, so I doubt the OS is at fault. If it happens again, try to notice if any particular stack has been opened during the session. I'm betting that's the problem.

I don't think you need the stacksInMemory handler, it just lists the stacks that are available. The Project Browser or Application Browser both do the same thing; you can look there and see all the stacks.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Code to check what is Not cleared out of memory

Post by chris25 » Sat Nov 02, 2013 8:20 pm

Ok then, Thankyou Jacque.

Post Reply