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
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 »

I have used PS cript and/or PCode since v2.
When v4 came out I noticed
1) constant attempts to send on network (bad)
2) excess memory consumption
3) constant load on CPU even when idle/minimized

Now, with 4.1 I am about ready to give up on the product.
I just had to close a single instance with three small VBscripts open, maybe 150K source total, becasue I received a popup that I was out of virtual memory.
Taskmanager showed total mem use at just above 2 gig, and shown PScript using
650K. I cloed PScript and taskmanager showed total in use mem at 650K, meaning
that closing PScript freed up 1.35 gig.

Not Good. And the CPU load in idle continues.
(PS the app also fails , Dr. Watson style, upon some resumes from hibernate).

Regards,
Roger
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

4.1 behaviors and memory leak

Post by Alexander Riedel »

I am not aware of us sending anything on a network.
Can you be more specific how you notice that we would do so?
The startup page has an RSS feed in it since 4.1, maybe if you shut that
page off.

I see a memory consumption with 3 files loaded and the startup page of
9368K, not that excessive I think.

I had it sit and run for quite a while and I see no inccrease in memory consumption.
Little 2% spikes (from 0 to 2%) in cpu activity are normal due to timers and background parsers. If you see more then something else is going on.

Can you give me some info on your OS, what type/size of file you have?
Hibernation is a tricky issue, my notebook crashes ANY app if I use hibernate vs sleep mode. I'd rather clear up the other topics first.

Alex

Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Russ Pitcher
Posts: 107
Last visit: Tue Jul 11, 2023 12:38 am

4.1 behaviors and memory leak

Post by Russ Pitcher »

I've noticed the same problem with the memory leak. I've currently got a 136-line VBscript file open and Task Manager reports 137,396K memory usage. I've got a 3000-line script that I regularly work on and yesterday the usage was over 850,000K at one point.

I do use hibernation fairly regularly, without any issues in PS for the past year, but I haven't hibernated for a couple of weeks and I shut down every night. I was going to do a little more testing before I posted, but as someone else is seeing the same problem...

Russ
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

4.1 behaviors and memory leak

Post by jhicks »

I've used PrimalScript for a long time and always have many files open. I've never noticed a memory problem. I'll do some more detailed testing and tracking. You may get more troubleshooting detail by using something like Process Monitor or Process Explorer from Sysinternals.
User avatar
EBGreen
Posts: 18
Last visit: Wed Mar 20, 2013 8:45 am

4.1 behaviors and memory leak

Post by EBGreen »

I am using Proc Explorer (my favorite by far) and I have noticed that when I opened PS with one file open (~1700) lines and immediately switch over and do other tasks it was sitting at around 85M. Then I started editing the file and it has slowly creeped up over the course of 30 minutes or so to 185M. When I switch to some other task, the usage does not go down at all. Just another data point.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

4.1 behaviors and memory leak

Post by Alexander Riedel »

Windows allocates device contexts and fonts and brushes and all that as needed and they are on a lazy release. Try miminizing the app and see if most of the memory usage goes away.

I have looked at the code and I only see one potential for a memory leak described in the first post. That would require that the code parser for each pass
crashes hard and even though the exception is caught, some stack memory and objects may leak. This would be very unusual but is the only thing I can see
for now. In such a case I really would like to see
if this is tied to a specific file, using a specific COM object or even to a specific computer.

Thanks for all the assistance you can provide.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

4.1 behaviors and memory leak

Post by jhicks »

I'm also using Process Explorer. I have 6 tabs open with file sizes ranging from 10 lines to a couple hundred to a couple thousand. Files are a mix of vbs, hta and wsf. It's actually been open for a while. I get a virtual memory size of 310MB and a working set of 7.8MB. Private bytes is almost 80MB. When I minimize PrimalScript, working set drops to below 3MB. Virtual size is unchanged.I'll work some more and see if I get any changes or leaks.
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
The network activity is noticed because the Windows Firewall states that PrimalScript.exe is attempting to access the network.
I now use 4.1.529
When I start PS4.1, before opening anything, just start it, taskmanager shows memory consumption at 66 to 67 meg
Mem use jumps about a meg on first script opened, moves up and down a reasonable 200K +/- with additional scripts opened/closed.
What I notice is that the base mem use only grows over time as the system uptime increases (I tend to hibernate, not restart, so it is not uncommon for a boot to live for weeks).
I have seen PrimalScript.exe CPU consumption peg the system, even when the UI in minimized and I am busy with other tasks, but more often I notice it using approx 10-12%
Thiis behavior is on (2.5 gig p4 mobile CPU with 2 gig ram) fully up-to-date XP Pro Sp2 (IE7)

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 »

oops
I see in my initial post I stated
"shown PScript using 650K. I cloed PScript and taskmanager showed total in use mem at 650K, meaning that closing PScript freed up 1.35 gig."
Of course those K were supposed to have been M
It was showing as using 650 meg, and ending PS freed up 1.3 gig
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

4.1 behaviors and memory leak

Post by jhicks »

abell,I take it when you hibernate you don't get an error about not enough system resources to complete the task. There was a problem for the longest time on XP with system with over 1GB of RAM. I have 1.5GB. It was related to a Windows memory frag problem or something like that. Eventually MS came out with a patch, which I've used to get around the problem.I'd be curious to hear how much RAM other people have where there is a problem.
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.