Re: Long start-up time of a program with include std/
- Posted by AndySerpa Mar 02, 2012
- 2178 views
[quote mattlewis]
I think that a few things that could have caused memory leaks have been cleaned up, in particular some cases where we weren't properly disposing of temps. It's possible that there were others, but I'm just going by memory.
Can you be more specific as to how the console was corrupted?
First, the memory leaks. I've got an "eval" library that evaluates string expressions, i.e. the string "2+2" will return 4, but it can also do Euphoric stuff and return sequences so it isn't only for math. I've had this library back to Eu 2.5 or so, I use it a lot. I noticed in the newer versions of Eu it causes memory leaks, but only when returning sequence values. As you can imagine, a string eval library uses indirect calls by routine_id quite a bit. I suspect that's where whatever leak is occuring is occuring, something to do with indirect calls (which could be nested several levels) where sequence values are involved. I have gone over it with a fine-tooth comb and am fairly confident the library is sound and the problem is within Eu. It really has to be since it is a pure Eu library with no low-level routines, it has no globals that could just be getting bigger and if it crashes it usually hangs instead of a proper Eu crash.
Anyway, I've got a few programs that rely heavily on those routines and I so I just live with the memory leaks. But they need to process a ton of data so instead of making a big loop I end up restarting the program a lot to "reset" the memory problems. Since this is a Windows console program, it is constantly popping up a new console (I usually just run with the normal interpreter) with its auto-restart of itself, which gets in the way of whatever else I'm doing when I really want it to be in the background. So to avoid this, I have sometimes open a console first, and then run it from the prompt with the console interpreter to keep all the text output confined to the one window, and then when it restarts itself it still remains in that same console. So...what happens when it finishes (even if you just run it once) with one of these leaky programs where it goes back to the prompt is that the prompt is corrupted, I can't type properly in it anymore or it ignores letters, for instance if I type "dir" it will say "ir" not a command or something like that. That's what I mean about a corrupted console.
And what's with the VMs and super-long start times on newer Eu's anyway? There is definitely something gone wrong. I've been living with these problems for at least a year so I've forgotten some of the details, just hoping you'll figure it out at some point. I can't remember if the first version to do that was 4.0.3 or 4.0.2. I can check. For a while I kept the older version on my VMs so they would go fast, but eventually it was becoming problematic for them not to be synced up with my main machine, so now I bind the programs from the main machine and copy them to the VMs to run. (Bound programs start right up.)