Project

General

Profile

Actions

Improvements #14171

open

Do not parse WMessageResourceBundle each time on WApplication launch

Added by Matthias Van Ceulebroeck 5 days ago.

Status:
InProgress
Priority:
Normal
Target version:
Start date:
12/03/2025
Due date:
% Done:

0%

Estimated time:

Description

Currently, when WMessageResourceBundles are used to load (locale-dependent) content for a WApplication, the WApplication will add those bundles to its collection.
Each time the application is constructed (and thus on each incoming session), this bundle is read and parsed (using rapidxml). This temporarily requires some memory.

For applications that have a lot of information in these bundles, the allocated memory can quickly grow.
Internally, we've noticed that this does not play nicely with applications that are hit heavily by bots. Resulting in peaks of memory usage.

Strictly speaking, this is not really necessary, and may even lead to monitoring software detecting too much memory usage.
To assuage this, the proposal is to not parse the whole bundle on each application load.

Instead, this information will be stored on the WServer, and the WApplication instance will create a copy of this information once it launches. This avoids the parsing round.
To ensure that this still contains the latest information, the WApplication will each time request from the WServer to check if the file has been updated (e.g. by last modified timestamp).

If not, a copy can be taken. If an update has occurred, the WServer should reread the file, and then pass the new content to the WApplication. Already existing WApplication instances will not be updated.


Related issues 1 (1 open0 closed)

Related to Bug #3824: Potential race in WMessageResourceBundle with WServer::setLocalizedStringsReviewRomain Mardulyn02/25/2015

Actions
Actions #1

Updated by Matthias Van Ceulebroeck 5 days ago

  • Related to Bug #3824: Potential race in WMessageResourceBundle with WServer::setLocalizedStrings added
Actions

Also available in: Atom PDF