I am looking for suggestions on how to debug this problem. For me, this is the number one problem with using Maple over the years.
Before I completely give up on Maple and move on to something else (I am getting very close to this point, as the time I am wasting is too much) as I invested long time on the code I have in Maple.
I like Maple programming and since it has debugger, I find it very useful, but I can't keep waiting 5 days each time on something that should finish running in 3-4 hrs on some other system.
This is a problem I have for many years with no solution version after version.
Obviously I can't make a MWE else I would, as this happens on my large program and happens randomly.
I can only explain what happens and I am asking what can I do to try to find the cause of the problem. I am not the only one who faced these types of problems. On the net, others complain about this.
This is what happens. I have my code in .mla and then I have a very small worksheet (I am also now running from command line line cmaple.exe, with same problem) where the code simply does a LOOP.
The loop reads problems one by one from sqlite database using Maple, and simply solves each problem one at a time then saves the result back to the sqlite database.
What happens is this: Lets says it reached problem 100. It suddenly hangs. I can wait 1,2,3,5 hrs and it does not move to the next problem.
I see mserver.exe sitting either at zero CPU or at high CPU. But most of the time at high CPU. Each problem should in theory not take more than few minutes to solve as I have timelimit of 20 seconds on each and every Maple call I make. (such as solve or simplify or any Maple call, I add timelimit to it).
So I have no choice left but to kill mserver.exe from windows when I noticed it has been long time running on one problem (as I print the time stamp).
Then restart the script and have the LOOP start from the same problem number it was hanging on which is 100 in this example, and now it runs and do not hang on this same problem.
So it was not that specific problem which was the cause else it would have hanged again.
The same thing happens now after few more dozen problems are processed. It is all random where it hangs next and how long it takes before the next hang shows up. I have thousands of problems in the database. On average it does this every 50 to 200 problems or so, it hangs. i.e. it can take one hr to few hrs before the next hang happens.
So I repeat the same thing and now it runs again until it hangs after few hrs or so again.
My PC is very fast intel PC (new) with 128 GB Ram and there is nothing else much running on it. It is a personal PC.
My question is: What could I look at when this happens to try to figure what the problem is? Is there any code I can add to problem more messages that could help when it hangs?
Any tools Maple provide to help debug this? Any ideas why it happens? Is there a way to turn on some Maple system level debugging that shows what it is doing when it hangs?
It can't be memory. And since it happens also when I run from command line and not just worksheet, it can't be Java interface problem. It might be hanging on sql call also (as it reads and writes to the database all the time) but I do not know for sure. This program is the only one accessing the SQL database at the time. I find Maple's SQL API very fast actually and never had problems with it.
The program does not do any outside calls to other systems, no internet calls and nothing like this. It only uses Maple functions and lots of call to latex() command. But it is all Maple code.
I am on windows 10 professional.
I am willing to try anything to find the cause of these random hangs.