Overall, the project can successfully implement animation and exercises for all the LL parsing algorithms, however, the implementation time taken was more than expected. This was due to a number of cross-platform and technology problems arose in different stages of the implementation period. Some of them can be solved straightaway and others need more tremendous time and effort to rectify them. It is also due to time constraint that restricts the amount of time, which can be spent, on solving a problem. Therefore, rectification work has to be abandoned even the problems have partially been solved with success.
All implementation in the first stage was performed under Windows 98 using the Sun JDK 1.2.2.006 for compilation of all source codes.
In the early stage of implementation, an initial animation for the First algorithm was implemented. Continuous coding efforts were conducted to code the animation, change the interface and modify the animation. Problems were encountered regarding inconsistent displacement of animated text objects on screen under different platforms.
Displacement problems continued to occur when inserting e, a, b, and Î symbols of the algorithm into the animation. To display these special symbols, the first approach was to use the Unicode characters for these symbols. While most of the symbols could be displayed under Windows and UNIX, these could not be done under Linux. As there was such a wide difference amongst platforms, the use of the symbols was abandoned and algorithms were written to replace their use.
Not until at the very late stage of the implementation was the memory problem made noticeable. At that stage, implementation work was performed under the Windows 98 platform and there were only two animations that have been developed in August. Although these two animations consumed a certain amount of memory to run, the memory problem was not noticeable at that time. This is because of two reasons. The first reason is that it will certainly take a while for these two animations to consume all the available memory before it crashes. The second reason is that Windows 98 provides virtual memory that makes it looks like to have more memory than it physically has. Therefore, the memory problem was not noticed at that time.
It was until the other three animations were developed that this memory problem became noticeable. Problems arose first in UNIX and Linux that the animation crashes Netscape or the system. And the time taken to crash varies from time to time. When the problem was discovered, time has been taken to trace the cause of the problem. Several tests were conducted and the cause was identified.
Since then several attempts have been taken to rectify the problem but without success. Later on, it was realized that the real problem was references to other objects have not been cleaned up properly. The cause was that references to objects in a class were not properly cleaned up after the class containing these references was destroyed. Although the class containing these references was destroyed, these references were still exist and referring to those objects. And the Java Virtual Machine (JVM) did not deallocate memory for the referring objects since there were still references referring to them. This caused the system memory to be fully used up after a number of animation have been started up.
Solution to this problem is to explicitly set all the references to null to completely remove the reference to that object and call the garbage collector explicitly to reclaim memory. Explicit call to garbage collector was made because of different implementation of garbage collection algorithm in different platforms. This was to avoid the garbage collector being scheduled and waited for the CPU to execute since in some platform implementations, the garbage collector has lower priority than other processes. This could cause memory to be used up again by the other higher priority processes before the garbage collector can free the memory.
This strategy can successfully reclaim about 70% of the allocated memory but not all. But in some situation only a very small amount of memory is being freed. However, due to time constraint and too much effort have been spent on solving this problem, no more time can be spent on solving the outstanding part of the problem.