The viewers module

The viewers module is documented in Doxygen format in the source files. Please run doxygen in the modules/viewers/documentation/ directory, then read the created documentation.

The VIEWERS system

The viewer list is maintained through the viewers system. Edit the file module.viewers in the module's top-level directory, and then run the operasetup.py script as usual (this is normally done through the build system) to update the viewer list. You can also update the list manually by running the viewers.py script in the src sub-directory.

Used OOM policies

Who is handling OOM?

Description of flow

Heap memory usage

Viewers keeps some lists of objects in memory. Each object is quite small, but there might be quite a few of them (like the list of viewers/plugins). Overall, allocated memory should be in the KB range, not MB.

Stack memory usage

Static memory usage

generated_viewers_data.inc includes a large array of pre-defined mime-types.

Caching and freeing memory

Freeing memory on exit

Memory is freed in ViewersModule::Destroy, called when terminating Opera.

Temp buffers

Temp buffers are used in Viewers::InsertViewer, Viewers::FindViewer, Viewers::GetViewAction and Viewers::ConfirmViewer. Especially Viewers::GetViewAction should be trivial to rewrite.

Memory tuning

module.viewers controls how many plugins should be known (and kept in the list in memory).

Suggestions of improvements

Viewers should be redesigned to not store as much data as it does now.