Bailey Kessing Posted January 12, 2016 Posted January 12, 2016 We are using SM (version 4.42) on a windows server and running a bunch of timed scripts to do various things. What is happing is that the server's HD is filling up with copies of the Jar files that are being used by the java code. For instance we are running a timed scripted every 15 minutes and a new instance of the Jar files is being created each time (and the old ones are NOT being deleted) at C:\Users\BCGCFMSvc\AppData\Local\Temp\ScriptMaster_bcgcfmsvc\Scriptmaster2975213099741919606commons-io-2.4.jar Any ideas why these are collecting and what to do?
john renfrew Posted January 12, 2016 Posted January 12, 2016 (edited) Are you running the script to load the jar fies EACH and every time you run the script (or is it in your start-up script)? This is mostly un-neccessary.. As far as I know, and with some experience. The JVM when instantiated needs the jars loaded once but then it is bound to the FMSE component of the server so only needs reloading when the Script Engine is re-started. There is an issue here which no one at 360w seems to want to address - which is that the FIRST time after you load jar files you can get a result from SMGetLoadedJars but then never again until a restart - which makes it useless as a checking mechanism. A workaround for this is a simple function which just returns true so you can check if that is currently giving you back an answer of 1. Edited January 12, 2016 by john renfrew
Bailey Kessing Posted January 12, 2016 Author Posted January 12, 2016 (edited) Ah, I am sure I am loading it each time as I thought I had to because I thought that on the server each time a timed script is run that it is a "new" session and everything needs to be like it is the first time…UGH. I am sure I read that somewhere at least as far as temp files are concerned that the server writes in the temp path. Darn, that explains a lot and I guess I don't need to register java code every time either? And yeah it would be nice to use SMGetLoadedJars to check whether the jars are loaded already so they don't accumulate!!! And thanks as always, John. Always a big help. Edited January 12, 2016 by Bailey Kessing
john renfrew Posted January 12, 2016 Posted January 12, 2016 Thanks Bailey.. RegisterGroovy( "SMisLoaded" ; "// v1.0¶ ¶ return true¶ ; isGui = false " )
Bailey Kessing Posted January 13, 2016 Author Posted January 13, 2016 BUT still no way to tell if a Jar is loaded right?
john renfrew Posted January 13, 2016 Posted January 13, 2016 Yes.. but if you load jars first and then have this as the last Groovy function loaded, and only if there are no errors in the loading jars and registering Groovy functions then you can be pretty certain everything is OK, and then this function can be used as the test If ( not SMisLoaded or SMisLoaded = "?" ) //fault condition, reset and re-load else //OK condition, dont re-load then..... end
Recommended Posts
This topic is 3579 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now