Deviare v.2.0‎ > ‎

Tuning & hacks

In order to assist development process, we added a few configuration keys that can be set up with the registry editor.

Open Registry Editor (with administrative privileges on Windows Vista and later) and create a subkey named "Deviare2" inside the following key:

HKEY_LOCAL_MACHINE\Software\Nektra\Deviare2

NOTE: If using a 64-bit O.S., use the x64 version of regedit.exe and do not create the key under HKEY_LOCAL_MACHINE\Wow3264Node\Software\Nektra\Deviare2 because it will be ignored no matter you are using the 32 or 64 bit version of Deviare.

Inside Deviare2 key you can create the following values:

DebugLevelMask: A REG_DWORD value that enables/disables debug output of different modules.

The following bit flags are available:

  • Tools = 0x00000008
  • Transport = 0x00000010
  • Engine = 0x00000020
  • Agent = 0x00000040
  • HookEngine = 0x00000080
  • HookEnginePreCall = 0x00000100
  • HookEnginePostCall = 0x00000200
  • Error = 0x00000400
  • Warning = 0x00000800
  • dlInformation = 0x00002000
The recommended bitmask is: Tools|Transport|Engine|Agent|HookEngine|Error|Warning = 0xCF8

In order to see the output, we recommend attaching WinDbg to the desired process.

MemMgrPoolMaxAge and MemMgrPoolCheckFrequency: REG_DWORD values that control memory pool management.

To avoid depending on the C runtime, Deviare internally uses a few pools of memory to minimize fragmentation. When a block of memory is freed, it will remain in the pool for a while instead of being released to the operating system in order to recycle it and avoid calling O.S. memory management functions that are slow.

The MemMgrPoolMaxAge value indicates how much time a free block will remain in memory until released to the O.S. The MemMgrPoolCheckFrequency controls the frequency where the LRU blocks are checked and discarded.

The default values are:

MemMgrPoolMaxAge: 10000 (ms)
MemMgrPoolCheckFrequency: 128 (every 128 free call the pool is trimmed)

SpyMgrMaxTransportMessageCount, SpyMgrTransportMessageDelay, AgentMaxTransportMessageCount, AgentTransportMessageDelay and MaxTransportFreeListMessageCount: REG_DWORD values that control some communication settings.

To avoid saturation and memory consumption when too many messages are being sent between the SpyManager and the agent(s), you can tune up these items.

SpyMgrMaxTransportMessageCount and AgentMaxTransportMessageCount set the maximum message count to send/receive before starting the delay operation. When the limit is reached, SpyMgr and/or Agent will begin to add some delays to message delivery in order to keep memory usage low until more buffers become available.

The delay time can be set using the SpyMgrTransportMessageDelay and AgentTransportMessageDelay values respectively. They are specified in milliseconds.

Also MaxTransportFreeListMessageCount specifies the number of free message buffers to maintain in memory and recycle when allocation is done.

The default values are the following:

SpyMgrMaxTransportMessageCount: 1000
AgentMaxTransportMessageCount: 500
SpyMgrTransportMessageDelay: 50 (50 ms)
AgentTransportMessageDelay: 50 (50 ms)
MaxTransportFreeListMessageCount: 500