Root > Advanced topics > Using EurekaLog with other software > Shared memory manager

Shared memory manager

Previous pageReturn to chapter overviewNext page   

Warning: this topic talks about using shared memory manager only. If you do not share memory manager between modules - then you can use any memory manager in any combinations without limitations.

 

EurekaLog is compatible with shared memory manager from FastMM. EurekaLog is not compatible with other implementations of shared memory manager. Therefore, if you're using shared memory manager - then you must select (and follow) one of the following scenario:

all modules doesn't use EurekaLog (you use 3rd party shared memory manager)
all modules use EurekaLog, but "Enable extended memory manager" option is turned off for all modules (you use 3rd party shared memory manager)
all modules use EurekaLog and both "Enable extended memory manager" and "Share memory manager" (or "Use existing shared memory manager") option are turned on for all modules (you use EurekaLog's shared memory manager)
(special: FastMM integration) some modules use FastMM with sharing enabled, some modules use EurekaLog with both "Enable extended memory manager" and "Share memory manager" (or "Use existing shared memory manager") option turned on for all EurekaLog-enabled modules (you use either EurekaLog's or FastMM's memory manager - see below for more info)

 

In other words, you can't have shared memory manager and different settings for "Enable extended memory manager" option in several modules. Consider enabling "Enable extended memory manager" option as using another memory manager. Obviously, in order to use shared memory manager, you must use the same memory manager in all modules. That's why you can't have different settings for "Enable extended memory manager" option.

 

If you're not using shared memory manager - then "Enable extended memory manager" option can be set differently for each individual module. Also, "Share memory manager" and "Use existing shared memory manager" options should be unchecked.

 

 

Using together EurekaLog and FastMM

If you're not using shared memory manager - you can mix FastMM and EurekaLog in your modules in any combination.

 

If you're using shared memory manager - you must enable "ShareMM" option for FastMM for non-EurekaLog modules (please, refer to FastMM's documentation) and you must enable both "Enable extended memory manager" and "Share memory manager" options for EurekaLog's modules. With these settings - you can mix FastMM and EurekaLog in your modules in any combination.

 

Warning: do not enable "ShareMM" option in FastMM for EurekaLog's modules (in case you use both FastMM and EurekaLog in the same module), unless you disable "Enable extended memory manager" option.

 

Since EurekaLog is compatible with FastMM - you can (for example) compile .exe with EurekaLog and both "Enable extended memory manager" and "Share memory manager" options checked; and you can compile DLL with FastMM and "ShareMM" option enabled (and without EurekaLog). This will work, and application will use EurekaLog's debugging features if .exe is initialized first. However, if you statically link DLL to .exe - DLL will be initialized first and FastMM will be used as application's memory manager. Thus, EurekaLog's memory debugging capabilities will be disabled.

 

To always use EurekaLog's memory manager:

do not statically link to DLLs, use dynamic loading

or

use EurekaLog in all modules

or

do not use shared memory manager

 

Note: if you're using both EurekaLog and FastMM in the same project - be sure to list FastMM's unit first and EurekaLog's unit seconds in uses clause of main .dpr file - regardless of options set.

 

 

Using together EurekaLog and Delphi

Starting with Delphi 2007 - there are standard AttemptToUseSharedMemoryManager and ShareMemoryManager functions, which you can use for sharing memory manager. These functions are wrappers for FastMM's sharing functionality (which is a standard memory manager since Delphi 2006).

 

Thus, this case is the same as "Using together EurekaLog and FastMM", but instead of FastMM and setting "ShareMM" option you should use ShareMemoryManager function.

 

Warning: if you're using ShareMemoryManager function and EurekaLog in the same project - be sure to disable "Enable extended memory manager" option.

 

Note: if you're using both EurekaLog and ShareMemoryManager function in the same project - be sure to call ShareMemoryManager function before running EurekaLog's units. You can do this by including unit which calls ShareMemoryManager function in its initialization section. You must list this unit before any EurekaLog's units in uses clause of main .dpr file - regardless of options set.

 

Usually you use EurekaLog with both "Enable extended memory manager" and "Share memory manager" options checked for executable, and you use ShareMemoryManager function for dynamically loaded DLLs.

 

 

Using together EurekaLog and SimpleShareMem

SimpleShareMem is wrapper for AttemptToUseSharedMemoryManager and ShareMemoryManager functions (see above).

 

Thus, this case is the same as "Using together EurekaLog and FastMM", but instead of FastMM and "ShareMM" you should use SimpleShareMem unit.

 

Warning: if you're using SimpleShareMem and EurekaLog in the same project - be sure to disable "Enable extended memory manager" option.

 

Note: if you're using both EurekaLog and SimpleShareMem in the same project - be sure to list SimpleShareMem unit first and EurekaLog's unit seconds in uses clause of main .dpr file - regardless of options set.

 

Usually you use EurekaLog with both "Enable extended memory manager" and "Share memory manager" options checked for executable, and you use SimpleShareMem unit for dynamically loaded DLLs.

 

 

Using together EurekaLog and borlndmm.dll or ShareMem

EurekaLog is not compatible with BorlandMM.dll and ShareMem. It's recommended to use FastMM with "ShareMM" option instead. If this is not possible - then you must disable "Enable extended memory manager" option for all your EurekaLog-enabled modules. Using of EurekaLog's debugging capabilities will be not possible.

 

Note: other EurekaLog's features (not memory-related) still will be accessible.

 

 

Using together EurekaLog and dynamic RTL in C++ Builder

EurekaLog is not compatible with BorlandMM.dll and dynamic RTL in C++ Builder. It's recommended to use statically-linked RTL instead. If this is not possible - then you must disable "Enable extended memory manager" option for all your EurekaLog-enabled modules. Using of EurekaLog's debugging capabilities will be not possible.

 

Note: other EurekaLog's features (not memory-related) still will be accessible.

 

 

Using together EurekaLog and other 3rd party memory manager

EurekaLog is not compatible with other shared memory managers. It's recommended to use FastMM with "ShareMM" option instead. If this is not possible - then you must disable "Enable extended memory manager" option for all your EurekaLog-enabled modules. Using of EurekaLog's debugging capabilities will be not possible. You may only use capabilities of your shared memory manager, but not EurekaLog.

 

Note: other EurekaLog's features (not memory-related) still will be accessible.

 

 

What can go wrong

If you'll use wrong settings - you can get these issues:

false-positive memory leaks;
missing memory leaks;
heap corruption reports;
access violations;
application's crash.

 

Typical reasons for these issues include the following:

Your code lists units in wrong order. For example, FastMM/SimpleShareMem/etc is not the first unit in uses of .dpr;
Your code uses conflicted settings. For example, DLL is compiled with ShareMem, but .exe is compiled with EurekaLog's "Enable extended memory manager" option.

 

 

See also:




Send feedback... Build date: 2023-09-11
Last edited: 2023-09-04
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/shared_memory_manager.php