IBM Support

Setting the stack size in IBM Rational Rhapsody

Question & Answer


Question

How can the stack size be increased or adjusted in Rational Rhapsody?

Answer

This can be achieved with the help of the property "CG:Class:ActiveStackSize". This property specifies the size of the stack allocated for active objects.

The stack size is determined by the implementation of the wrapper thread object <env>Thread, derived from the OMOSThread interface.
Specifically, the stack size is defined in the constructor body, which is executed upon the thread creation call.

For example, in the constructor for a VxThread object in VxWorks, the stack size is set to the default value of OMOSThread::DefaultStackSize in VxOS.h, as follows:


"
VxThread(void tfunc(void *), void *param,
  const char* const name = NULL,
  const long stackSize =
  OMOSThread::DefaultStackSize);
"

DefaultStackSize in OMOSThread is set to DEFAULT_STACK (defined as 20000 for VxWorks) in the VxOS.cpp file, as follows:

"
const long OMOSThread::DefaultStackSize = DEFAULT_STACK;
"




To change the size of the stack for all new threads, change the definition of DEFAULT_STACK in the <env>OS.h file. Alternatively, you can change the size of the stack for a particular thread by passing a different value as the fourth parameter to the thread constructor.

By default the stack size is set in an operating system-specific manner, based on the value of the ActiveStackSize property for the framework [CPP_CG::Framework::ActiveStackSize]

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.5.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21421971