Workspace (ws) Resources
- wsCurrentSize
-
You can determine the total size currently allocated for all
workspaces managed by the Workspace object at any
point in an HLU program by retrieving the value of the read-only
resource wsCurrentSize. To do this, you must first get the
id of the Workspace object using the
NhlGetWorkspaceObjectId
function.
Default: 0
- wsMaximumSize
-
This resource specifies the total size in bytes that is allowed to be
allocated at any single time for all workspaces managed by the
Workspace object during the execution of an HLU
program. If the Workspace object is asked to allocate
or reallocate a workspace such that this value would be exceeded, the
Workspace refuses to attempt the allocation and
returns a fatal error. In order to modify wsMaximumSize you
must first get the id of the Workspace object using
the
NhlGetWorkspaceObjectId
function. Alternatively, in order to permanently change the size you can
put the line such as
*wsMaximumSize : 100000000
into your .hluresfile. This would raise the limit by a factor of around 6.Note that the default limit was set at a time when the memory available on a typical computer was much smaller than today. If you are using an average computer by current standards, there would no problem reserving the amount of RAM specified above for workspace use. On the other hand, when very large amounts of workspace are required, usually the processing time also increases greatly. Sometimes, errors that indicate the workspace is exhausted actually are a symptom of another problem with the code.
Default: 16777216
- wsThresholdSize
-
Whenever the sum of the size in bytes of all currently allocated
workspaces exceeds the value of the resource wsThresholdSize,
the Workspace object attempts to reduce the total
allocation below the threshold size by freeing workspaces that are
not currently in use. If it is necessary to keep the data in a
workspace, the contents of the workspace will first be written to a
file. The total size allocated to workspaces may exceed
wsThresholdSize if the total size of workspaces currently in
use exceeds the threshold size. In order to modify
wsThresholdSize you must first get the id of the
Workspace object using the
NhlGetWorkspaceObjectId
function.
Default: 4194304