Opened 10 years ago

Last modified 10 years ago

#2705 new defect

Graceful error on inability to allocate cache

Reported by: Anthony J. Bentley Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: unanswered
Cc: Patch:

Description

$ ulimit -d
524288
$ 0ad
Cache: 500 (total: 3975) MiB
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abort trap (core dumped)
$

There's nothing wrong with failing here. But the error message plus coredump is a little unfriendly, especially since people who use the .desktop file will not not see the error message.

It would be nice if 0ad were to cleanly error out (via a graphical message box?) and exit if it can't allocate enough memory at the beginning.

Yes, these ulimits are low, but they are the default on some platforms like OpenBSD. A more readable error message would help new users realize the problem sooner.

Attachments (1)

openttd-lowmem.png (88.3 KB ) - added by Anthony J. Bentley 10 years ago.
screenshot: OpenTTD in low-memory situation

Download all attachments as: .zip

Change History (3)

comment:1 by Stan, 10 years ago

Keywords: unanswered added

comment:2 by Anthony J. Bentley, 10 years ago

OpenTTD is an example of doing the right thing: it informs the user with a visible warning message and continues with a reduced cache size instead of aborting.

by Anthony J. Bentley, 10 years ago

Attachment: openttd-lowmem.png added

screenshot: OpenTTD in low-memory situation

Note: See TracTickets for help on using tickets.