How to clear virtual memory

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

How to clear virtual memory

Post by alemrantareq » Sat Dec 10, 2016 7:20 pm

Hello, we all know livecode uses windows paging file (virtual memory) to store the variable data we use in our scripts. the lager the variable data is, the more space in paging file used by livecode. I came to realize that "put empty into variable" does not actually restore the space in vritual memory that been used to store the variable data. So I'm interested to know if its possible to clean the virtual memory and restore the space as well, because my tool sometimes have to handle the process with a variable data in big size.

Any positive reply would be much appreciated :)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6044
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to clear virtual memory

Post by FourthWorld » Sat Dec 10, 2016 7:47 pm

alemrantareq wrote:we all know livecode uses windows paging file (virtual memory) to store the variable data we use in our scripts...
Do we? How are you observing that?

Normally VM is managed by the OS rather than an application. How large is your variable that it needs to dip into swap? How much RAM is installed on your system?

As far as general memory usage, if you have, say, 1 MB of data in a variable, and you replace that with 0 bytes (empty), you should see a reduction of memory allocation.

There is some modest overhead in maintaining the variable itself, but it's just a few bytes.

In some cases it may require the engine to get to idle before you'll see recovered memory.

Can you tell us a bit more about what your script is doing, and how you're measuring its RAM use?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Windows”