... | ... | @@ -112,9 +112,13 @@ In general one will gain a higher precision when using the raw values due to a l |
|
|
|
|
|
### Exercise 6
|
|
|
|
|
|
The following figure represents the free memory available while the robot car is performing line following. The data for the top graph is measured using preallocated strings in the calls to ´LCD.drawString´ - data for the bottom graph is measured using string literals.
|
|
|
|
|
|
![alt text](https://gitlab.au.dk/uploads/rene2014/lego/f828f01da7/FreeMemoryMeasurements.png "Exercise 6 - Measurements")
|
|
|
|
|
|
From these data, we can see that using strings directly in will result in allocating a new string each time that code is invoked - that is, the JVM on the NXT does not perform string interning. Thus, using string litterals will result the GC being invoked more frequently.
|
|
|
The data shows the available memory decrease during operation, as memory is being allocated in every iteration of the control loop, and the garbage collector periodically reclaiming memory.
|
|
|
|
|
|
From this data, we can see that using string literals directly will result in allocating a new string each time that code is invoked - that is, the JVM on the NXT does not perform string interning. Thus, using string litterals will result the GC being invoked more frequently, and may degrade performance.
|
|
|
|
|
|
## Conclusion
|
|
|
In this lesson 1 we have done expriements with the light sensor and simple control algorithms. It is clear from the results that external light affects the light readings significantly should therefore be considered in future applications. |
|
|
\ No newline at end of file |