Running the DLL in a Separate Process

By default, GoldSim loads DLLs used by External elements into the GoldSim process space. GoldSim and the all external DLLs therefore share the application’s address space, which is usually limited to 2 GB on Windows operating systems. In some case, a single DLL itself may have large memory requirements (e.g., if it loaded large sets of data from files or databases), or it could statically or dynamically allocate large blocks of memory. If the combined memory requirements of GoldSim (the executable), the GoldSim model (including all model properties, buffers and result values) and all DLLs exceeds 2 GB, GoldSim will be unable to carry out the simulation. The user will be forced to preserve memory by saving fewer histories or time steps, or by turning off saving of results for certain elements.

To circumvent this limitation, GoldSim provides a feature that allows external DLLs to be executed outside of the GoldSim process space. If Run in separate process is checked, GoldSim does not load the DLL into its process space. Instead, it launches a separate small DLL server with its own private process space. The DLL server works like a middleman who dispatches information between GoldSim and the external DLL. Each DLL that runs in a separate process has its own DLL server. Therefore each DLL has access to a private 2 GB process space, which is not shared with any other DLL or application.

   Note: If the DLL references any external files and it is run in a separate process, it will look for those files in the folder where the DLL resides.  If it is not run in a separate process, it will look for the files in the folder where the model file resides.

   Note: 64-bit DLLs must be run in a separate process.

Related Topics…