News for hackers. Stuff that matters.
Re:Android Ported to C# by Zigurd on Tuesday May 01, 2012 @07:42PM (#3916855)
"Free memory" in a garbage-collected managed language is difficult to measure. If you don't have to GC, the performance-minded choice would to not GC. Every computation costs battery life, so I would suppose Android's GC is tuned to not run if it doesn't have to.

If you look at the specifications of system.gc(), it can be implemented as a placebo, like the "push to walk" button at the street corner. So even explicitly GC'ing isn't guaranteed to do anything.

Android also has a strategy for "swapping" components within a process, and whole processes. This is, effectively, Android's GC strategy across processes. An Android system's memory, especially on small-memory devices, should always look full-ish, but you can almost always launch a new task, since GC and components and process "swapping" (the "destroy" phase of component lifecycle) and GC can almost always make room for more.

Re:Android Ported to C# by mulander on Wednesday May 02, 2012 @03:12PM (#3920644)
> like the "push to walk" button at the street corner.

Thanks for using that comparison - oddly enough it provided some nice entertainment for me :D

Since I wasn't aware if "push to walk" was a cultural reference that I might not know I started some quick research that lead me to a couple of interesting articles.

I started off with a search that resulted in the Placebo Button (http://en.wikipedia.org/wiki/Placebo_button) article on wikipedia.

From the references section in that article I found a nice column from NY times about the street crossing buttons in NY (http://www.nytimes.com/2004/02/27/nyregion/27BUTT.html).

From which I picked up an interesting pattern in traffic control solutions - called the 'Barnes Dance'.

Which lead me to this video (http://www.streetfilms.org/barnes-dance/) from which I learned that it's also known as Pedestrian scramble (http://en.wikipedia.org/wiki/Pedestrian_scramble).

It's funny how a couple of well picked words on your side has lead me to an entertaining research.

I just wanted to say thanks and share this experience :)

Re:Android Ported to C# by inoop on Wednesday May 02, 2012 @03:48AM (#3917988)
I think the biggest problem with embedded GC is that you generally don't want to do pay the memory overhead that comes with generational algorithms. It's a pity that most Java systems are layered on top of some C-based OS, so that each process effectively has to have its own heap, with all the memory overprovisioning that entails.
Re:Android Ported to C# by reirob on Wednesday May 02, 2012 @05:46PM (#3921374)
Can you tell what you meant by "most Java systems"? Which are the Java systems that are NOT running on top of some C-based OS?
Re:Android Ported to C# by inoop on Thursday May 03, 2012 @08:05AM (#3923415)
Managed operating systems such as JNode (Java based) or Singularity (.NET based) have managed kernels - everything is written in a memory-safe language. The OS can verify the memory-safety of a program in the loader (bytecode verification), so that there is no need for an MMU to implement process isolation; different processes can share the same heap. There is also a big performance advantage as process switching is essentially as fast as thread switching. IPC is typically done using message passing, but Singularity for example also allows processes to set up a shared memory space.

edit: relevant paper: https://agora.cs.illinois.edu/download/attachments/28320883/...

Re:Android Ported to C# by reirob on Thursday May 03, 2012 @03:06PM (#3925239)
Thanks for this information. I am curious to see in which domain such Operating Systems will be used first. I am wondering actually why Google did not use such an OS architecture for Android (or Apple for their phones).