4.1 behaviors and memory leak

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 17 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

4.1 behaviors and memory leak

Post by FrankAndrew »

Hi Alex,

SORRY. I am editing a Visual Basic Script (vbs) file.
When I minimize PSP the memory usage only changes slightly less than 10 KB a little bit up and down, within two minutes of the minimizing the memory usage stablizes with practically no difference. The other changes are in the MB range. Could you tell me a TRACE mode that I can turn on so that you can 'see' exactly what is happening?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

4.1 behaviors and memory leak

Post by Alexander Riedel »

No, unfortunately it is not that simple.

Please go to "Tools - Options - Text Editor - PrimalSense"
Switch off "Enable Live Syntax Check"

Restart PrimalScript and see if that remedies your leak.

Now, if it does, I need the exact version of your VBScript.dll
If it doesn't, well, I'll have to find myself another tree to bark at....

Alex

Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

4.1 behaviors and memory leak

Post by FrankAndrew »

GREAT SHOT ALEX,

You hit the TARGET!!

With the "Enable Live Syntax Check" switched off, the 'memory' leak is GONE.

But I was hoping that that was NOT the problem, BUT...

Here is the Version info you want/need:

File: vbscript.dll
located in: C:WinNTsystem32 and .dllcache
size: 463,906 Bytes
Date: 26 Feb. 2002
Time: 15:58
Version: 5.6.0.7426

Now what?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

4.1 behaviors and memory leak

Post by Alexander Riedel »

Now I have to find a way to make PrimalScript not care when VBScript.dll has a leak :-) Actually in all fairness I have not yet determined that it actually has one.







As a COM object it is subject to what is called lazy release. Meaning if you discard the object it does not get unloaded in anticipation that you may need right away again anyway. As such this can look like a leak.

Problem is, VBScript.dll does not like it when you hang on to it and re-use the instance either. So to make a long story short, I have to pull some tricks out of my hat.

Thanks for the help.

Alex

Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

4.1 behaviors and memory leak

Post by FrankAndrew »

I am glad I could help.
I am sure that you will find a good workable solution.
Maybe you should let us set how often the 'Live Syntax Check' takes place.
i.e. after we save the file or only after we have changed the file (but not yet saved it) or something like that.
User avatar
abell@winintern.com
Posts: 10
Last visit: Fri Feb 02, 2007 4:58 am

4.1 behaviors and memory leak

Post by abell@winintern.com »

Hi Alex,

In my case this is observed when doing simple editing of VBScript files . . .
The normal stuff - writing code, moving lines or blocks of lines around, occassionally adding a snippet, or defining a new snippet and closing it, not running script within PS (rather much select all /copy to paste in txt editor on server, occassionally copy down and paste/save in PS of the version on server).

From what you have said it actually sounds like PS may be exposing an error in the runtime and/or Windows support routines.

I do not know from where other posters are getting the small footprint mentioned (approx 3 meg.)
I open a new, and empty (no script, not using welcome/splash browse page) and the "mem usage" is at 66,564k, peak 68,368k, vm size 58.672k
That is pretty repeatable, and the figures hold - unless/until app is minimized.
When minimized mem usage goes down to just above 2 meg, when focus returned this goes up to about 4.7meg - over and over is repeatable.

I had not noticed the release upon minimization previously, so will now pay attention.
Not keeping PS open when hibernating does not give much of a change to catch this mem growth happening, so I will probably return to my old ways, but watch to see if I can get a clue as to what actions contribute to the mem growth, and also pay attention to effect of mem release when minimizing.

Roger



Roger
User avatar
donj
Posts: 416
Last visit: Thu May 29, 2008 5:08 am

4.1 behaviors and memory leak

Post by donj »



Just so you know I'm not faking it: Loaded PrimalScript 4.1, opened about a dozen files (VBS and PS1), minimized the app. Here's my Task Manager... roughly 3MB memory usage :). Which is more or less what you're saying you observe, too - when I first opened, it was at about 14MB or so, I guess.

Note that different editions will, obviously, make a difference - I'm using Enterprise.
User avatar
donj
Posts: 416
Last visit: Thu May 29, 2008 5:08 am

4.1 behaviors and memory leak

Post by donj »

Live syntax Checking occurs as you type - hence the "live" name - so it's more or less continuous. I'm sure Alex can be much more specific, but I suspect it's whenever you move off of a line - such as arrowing off the line, or hitting Enter; that's the point at which the line can be considered "complete" (in theory) and the script submitted to the VBScript engine to check for errors.

It's definitely not as infrequently as a file save, though; if it waited until a file save (for example), it wouldn't be close to "live."

I am glad I could help.
I am sure that you will find a good workable solution.
Maybe you should let us set how often the 'Live Syntax Check' takes place.
i.e. after we save the file or only after we have changed the file (but not yet saved it) or something like that.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

4.1 behaviors and memory leak

Post by FrankAndrew »

Hi again Don,

I was just trying to give Alex a couple of tips as to when the 'Live Syntax Checking' could possible be done. As a programmer myself, like you, I am happy to hear the ideas from the customers (and all of them) so that the software can work for everyone at the same time just configured differently.

I know he will find a good solution for this 'problem'. I like the Sytax checking very much, but as long as it costs me all of my memory I will wait until SAPIEN nails it down to work as it was intended from the beginning.

Just let me know when you think you have it, I would be happy to test it for you being as I can reproduce this problem in less than 5 minutes with the scripts that I have.


Live syntax Checking occurs as you type - hence the "live" name - so it's more or less continuous. I'm sure Alex can be much more specific, but I suspect it's whenever you move off of a line - such as arrowing off the line, or hitting Enter; that's the point at which the line can be considered "complete" (in theory) and the script submitted to the VBScript engine to check for errors.

It's definitely not as infrequently as a file save, though; if it waited until a file save (for example), it wouldn't be close to "live."

[quote]I am glad I could help.
I am sure that you will find a good workable solution.
Maybe you should let us set how often the 'Live Syntax Check' takes place.
i.e. after we save the file or only after we have changed the file (but not yet saved it) or something like that.
[/QUOTE]
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

4.1 behaviors and memory leak

Post by Alexander Riedel »

Fixed in the lab. Handing it off to testing tomorrow.
Just in case you are curious. :-)
Alex
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 17 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.