What causes a VAJ workspace to become corrupt? How can it be prevented? Are the corrupt workspace problems fixed in later releases of VAJ?

Eric Clayberg

Almost any system exception trapped by VAJ and shown in the log window is sufficient to corrupt the workspace at some level. There are almost an infinite number of gradations of corruption, however, ranging from benign (e.g., won't have any noticeable or immediate effect) to critical (e.g., crashes the environment immediately). Almost all system exceptions have the side effect of growing the base size of your workspace file by filling it with dead "junk" (e.g., dead processes, un-GC'ed windows and other resources, etc.).

Ideally, any workspace in which you have had even a single system exception should be replaced as soon as it is convenient (obviously version off your work to make it easier to reload). After you first install a clean workspace, load all of your code and install any other add-ons, you should save your workspace and make note of its size on disk. Unless you are loading lots of additional code into it, your workspace file should never grow more than a couple MB in size during normal usage. If you find your workspace file getting bigger every day or if you notice that it is more than a few MB larger than your baseline number, you are almost guaranteed to be working with a corrupt workspace that you should replace immediately. You might be OK temporarily, but it will almost always "bite" you when you least expect it or can least afford it. Replacing your workspace file every week might actually be a good rule of thumb.

There really is no way to "solve" the problem because there is no single well defined problem that causes it. One can certainly fix specific causes of workspace corruption, but that won't prevent other causes. About the only way to absolutely avoid working with a corrupt workspace is to use a fresh one for every session (and then quit and restart after any logged system exception).