Scripting Memory-Leak / Speed Degrading

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Scripting Memory-Leak / Speed Degrading

Post by jupe »

I am also having problems, after a while of dissecting some complicated scripts I have narrowed it down and created this example, if I load a script like this:

Code: Select all

	$menu = <<<>>>
"Error" sub "T2";
"Test1 : T1"	status 1;
"_Test2 : T2"	status 2;
>>>;
	load $menu,, "s";
And click on the first item "Error", I get an error "no matching labels", but if the same $menu is in a normal file.xys no error is generated, there have been no problems in the past with this implementation.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Memory-Leak / Speed Degrading

Post by admin »

Oh yes, that's since 20190919. Fix comes.

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Scripting Memory-Leak / Speed Degrading

Post by Filehero »

Hi Don,

unfortunately, my issue is still (again?) there (breaking nearly the half of my existing scripts). To make it easier I re-copy the script example already posted.

Base script:

Code: Select all

include_once "testLib.xys";

// call lib function
  callTest();

// build in-the-fly script code
  $mscript = <<<SCRIPT
include_once "testLib.xys"; // <-- INDENTING THIS STATEMENT EVOKES ERROR AGAIN -->

  callTest(); // <-- THIS IS WHAT SHOULD WORK AFTER ALL -->
SCRIPT;

  // NOW THE ERROR GETS THROWN HERE - this logic has been working for years
  load($mscript, , "s");
base.7z
(416 Bytes) Downloaded 106 times

Referenced script:
testLib.xys
(95 Bytes) Downloaded 104 times
Broken behavior: callTest() is called only once (when the call is done from the base script)
Expected behavior: callTest() is also called from the inline-assembled script run by load()

Note: both includes are done using include_once.

Control: version 20.40.003 is working fine (with include as well as include_once).


Filehero

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Scripting Memory-Leak / Speed Degrading

Post by Filehero »

Hmm, a single-clicked bump isn't ery nice.

Humble bump. :wink:

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Memory-Leak / Speed Degrading

Post by admin »

This is what it's about here?

Code: Select all

<-- INDENTING THIS STATEMENT EVOKES ERROR AGAIN -->

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Scripting Memory-Leak / Speed Degrading

Post by Filehero »

No, sorry - I should have deleted that old comment the before doing the copy.

This time I haven't found any possible cause (indentination hadn't any influence afair), the (2nd) call ofcallTest() referenced from the inline-assembled script simply doesn't happen.

admin wrote: 30 Oct 2019 14:34 This is what it's about here?

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Memory-Leak / Speed Degrading

Post by admin »

OK, saw it and fixed it. Next beta. What a can of worms... :cup:

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Scripting Memory-Leak / Speed Degrading

Post by Filehero »

First quick check - the finish is much brighter now.

Re-test with my test scripts: [x]
Re-test with my critical scripts: [x]

:beer: :now: :red: :wine: :for: :celebration:

Code: Select all

v20.50.0107 - 2019-11-01 13:46
    ! Scripting: The fix (from v20.40.0005) concerning repeatedly loading the 
      same resource file needed some more polishing. Polished again.
Has the original "improvements" been completely rolled-back now code-wise?

Btw, to me it was really irritating that no one else has been complaining, I thought repeatedly loading the same resource file is used much more by others.

Anyway, thanks heaps!!!!!

Filehero

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Memory-Leak / Speed Degrading

Post by admin »

Filehero wrote: 01 Nov 2019 18:18 Has the original "improvements" been completely rolled-back now code-wise?
Nope, I just polished it. :)

Post Reply