We're updating the issue view to help you get more done. 

ICU does not report Out-Of-Memory (OOM) if it fails to memory map the data file(s) when calling API(s).

Description

When you are using ICU with memory-mapped data file(s), and ICU fails to map the data file due to being out-of-memory, it does not bubble this failure up to the API that was called.

For example:

1 2 char localeID[] = u8"en_US"; ucol_getKeywordValuesForLocale("collation", localeID, false, &status);

If memory-mapped data file can't be loaded at all due to being Out-of-memory, then you will get back the error U_MISSING_RESOURCE_ERROR from this API call, rather than U_MEMORY_ALLOCATION_ERROR, which might be a bit surprising to the caller of the API.

This can lead to the application thinking that there are no resources for "en_US" or "en" (or even "root").

If ICU can't load the data file due to being out-of-memory, then it would likely be better to report as such.

Environment

Status

Assignee

Jeff Genovy

Reporter

Jeff Genovy

Labels

Reviewer

Andy Heninger

tracCreated

Apr 18, 2018, 6:08 PM

tracOwner

jefgen

tracProject

ICU4C

tracReporter

jefgen

tracStatus

accepted

Components

Fix versions

Priority

major