• 0 Posts
  • 211 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle

  • I was raised catholic and went to a catholic primary school. At one point we had a class where we would visit the local catholic church once a week and the priest would explain things about how things worked in church.

    On one such occasion he pointed out a red light near the altar and said that the light indicated that god was present in church. (Apparently it’s called a ‘sanctuary light’ in English). I spent an entire week trying to figure out how this god-detector worked. I had several designs worked out in my head, like it having an unreachable switch that could only be pressed by god himself.

    The next week we arrived at church a little early and I caught the priest putting a candle in it and lighting it himself. That’s when I started to realize the whole thing was one big scam.








  • Cycling through fresh snow is fine, it’s the snow that has been driven over and compacted that’s really slippery.

    When you ride over the slippery icy stuff, don’t brake hard, don’t make any sudden turns. Better to just stop pedaling and let your bike roll. Watch out for hard frozen ridges of snow.

    Usually the cycle paths are salted early, it’s the part from the busy cycle paths to your front door and the last bit to your destination where you have to watch out.

    Snow dampens sound so be careful around cars, you might not hear them coming. If you wear a coat with a hood it might be more difficult and annoying turn your head, resist urge to not look when crossing roads.










  • And yet, I’ve never run into RAM problems on iPhones, both as a user and as a developer. On iOS an app can use almost all the RAM if needed, as long as your app is running in the foreground. Android by contrast is much stingier with RAM, especially with Java/Kotlin apps. There are some hard limits on how much RAM you can actually use and it’s a small fractIon of the total amount. The actual limit is set by the manufacturer and differs per device, Android itself only guarantees a minimum of 16MB per app.

    The reason is probably because Android is much more lenient with letting stuff run in the background so it needs to limit the per-app memory usage.

    Those apps also use more RAM than an equivalent iOS app, simply because they run on a garbage-collected runtime. With a GC there is a trade-off between performance and memory usage. A GC always wastes memory, as memory isn’t freed immediately once no longer in use. It’s only freed when the GC runs. If you run it very often you waste little RAM at the cost of performance (all the CPU cycles used by the GC) if you run it at large intervals you waste a lot of RAM (because you let a lot of ‘garbage’ accumulate before cleaning it up). In general, to achieve similar performance to non-GC’d code you need to tune it so it uses about 4 times as much RAM. The actual overhead depends on how Google tuned the GC in ART combined with the behavior of specific apps.

    Note that this only applies to apps running in ART, many system components like the web browser are written in C++ and don’t suffer from this inefficiency. But it does mean Android both uses more RAM than iOS while at the same time giving apps less RAM to actually use.

    It basically comes down to different architectural choices made by Google and Apple.