Live data from Hacker News

I Want My Memory, Apple

gamesfromwithin.com

21–24 of 24 posts

Re: I Want My Memory, Apple

#21
post #20
post #19

Earlier quoted context omitted.

> Is an application supposed to be able to run on arbitrarily low memory? Of course. Experience is everything on iPhones (and should be on most devices). If an app crashes, it's bad.

But it doesn't seem to be doable. As the original poster said,you can hardly unload a level in a game if there is insufficient memory. Sorry, but that requirement seems silly to me.

You are right, it doesn't seem to be doable. And that's the point, which is why the author is complaining/writing about it.

Why is a requirement for games not to crash silly? Or do you think apps cannot crash but games can?

Re: I Want My Memory, Apple

#22
post #21
post #20

Earlier quoted context omitted.

But it doesn't seem to be doable. As the original poster said,you can hardly unload a level in a game if there is insufficient memory. Sorry, but that requirement seems silly to me.

You are right, it doesn't seem to be doable. And that's the point, which is why the author is complaining/writing about it. Why is a requirement for games not to crash silly? Or do you think apps cannot crash but games can?

It just seems reasonable that an application has a minimum memory requirement. Is it really so bad on the iPhone that memory can be arbitrarily low? What if the iPhone never gives my app more than 1KB memory? I just see no way to make it run reasonably with 1KB.

Also a crash is different from exiting with an error (although still annoying from the user's perspective).

Re: I Want My Memory, Apple

#23
post #5

Earlier quoted context omitted.

Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Although you're totally right that the IPhone wasn't designed as a console, so this process is probably good enough for most apps. Even more interresting than the post in itself (wich is very interresting) is the hack proposed by fishermen21 in the comments - http://gamesfromwithin.com/?p=428#co…

Well the way you use memory in a game is non deterministic, so "OS having time to free memory" is not a good enough answer. Once the memory is made available to the foremost application, it will not be reclaimed by the operating system; As a game author you do not need to attempt to introduce determinism across all allocations, but instead ensure that initial allocations are not so rapid as to outpace the low-memory…

In a way, why does it matter if it has paging or not? Either way the total memory available is limited (hard disks don't have infinite storage space).

Re: I Want My Memory, Apple

#24
post #22
post #21

Earlier quoted context omitted.

You are right, it doesn't seem to be doable. And that's the point, which is why the author is complaining/writing about it. Why is a requirement for games not to crash silly? Or do you think apps cannot crash but games can?

It just seems reasonable that an application has a minimum memory requirement. Is it really so bad on the iPhone that memory can be arbitrarily low? What if the iPhone never gives my app more than 1KB memory? I just see no way to make it run reasonably with 1KB. Also a crash is different from exiting with an error (although still annoying from the user's perspective).

Oh, I see you mean exiting gracefully with an error instead of crashing. That's different, my bad.

But not so different though, because telling a user your game/app can't run anymore because doesn't help and the user can hardly do anything to help give the app a higher chance to run. Of course they can start Safari, close all the tabs etc, but it is (1) tedious and (2) many users wouldn't know how to do it (3) again destroys the experience.

Also, try to catch the error may not work in practice. It will work sometimes, but there's really no guarantee how much time you have to save the current state, and show a nice error because the app is shutdown.

The irony is that the environment uses reference counting to allow better control of memory yet there is this limitation. Or maybe it had to use reference counting because of this limitation.

Still it's a pretty nice platform to code for, it's just us developers asking for more :)

Post reply on HN