This is a mirror of official site: http://jasper-net.blogspot.com/

See and hear the effects of Garbage Collection

| Sunday, February 27, 2011
Sometimes you forget that GC’s occur: it’s hard to see it’s effect, but what does Garbage Collection do to your code?

A long time ago (3 decades!) I used Fortran and Assembly code for a PDP-11 16 bit computer to design real time signal processing systems. Two of these were used to detect submarines: one would make a very loud noise (think a very big sonar Ping), and the other would pretend to be a submarine by listening to the sound and echoing back, at various set strengths (1X, 10X, 100X), as if it were a particular kind of submarine pointing in various directions. “I’m a Submarine”, “I’m a Submarine” “I’M A SUBMARINE”. If all 3 of these echoes were heard, then we know we heard all signal strengths. If only 2,then we know by how much the target was missed.

The sound maker generated a huge amount of noise underwater via controlling precisely the release of an array of high pressure air guns. The sound wavefront could be steered via subtle variations in firing timing. Sound travels so well and fast underwater!
A typical scuba tank is about 8 inches in diameter and 20 inches long, holding maybe 3000 PSI and is very dangerous (think exploding shark a la Jaws). Our array of 10 air guns were 10 inches in diameter and 20 feet long, with 10,000 PSI.

The listener computer on  a different boat hundreds of miles away used an underwater microphone to record the sounds into memory at a sub 1Khz sampling rate using an Analog to Digital converter. The code received the data via DMA (Direct Memory Access) and double-buffered it: as one buffer was being filled, the other would be processed, such as copied to an Array Processor to do a Fourier Transform.
The signal would then be convolved (multiplications, additions) with various prerecorded echoes from a submarine, and then the signal was D-A converted to a sound blasted via an underwater speaker.

The CPU needed to be fast enough to keep up with the incoming raw data: if I tuned it to sample a little bit faster, bad things would occur: missing data, distortion, etc.
I had to have precise control of these real time systems for accuracy and reliability.

Designing a real-time system with a Garbage Collected system could be quite difficult in tight performance scenarios. A GC during a sampling could cause lost data.

Read more: Calvin Hsia's WebLog

Posted via email from Jasper-net

0 comments: