1. --managed-mem Enable managed memory. Used on Windows.
- Posted by andi49 Feb 07, 2014
- 1999 views
Hallo
this option seems to be ignored on windows.
At least the binary still displays 'Using System Memory'
Andreas
2. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by jimcbrown (admin) Feb 08, 2014
- 1978 views
Hallo
this option seems to be ignored on windows.
At least the binary still displays 'Using System Memory'
Andreas
That sounds like a bug. Looking at the source code, however, I think the bug is limited to an inaccurate display - it says system memory but is really using managed memory. The issue is that Makefile.gnu isn't passing the appropriate -D EU_MANAGED_MEM flag, unlike Makefile.wat
3. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by andi49 Feb 09, 2014
- 1907 views
Hallo
this option seems to be ignored on windows.
At least the binary still displays 'Using System Memory'
Andreas
That sounds like a bug. Looking at the source code, however, I think the bug is limited to an inaccurate display - it says system memory but is really using managed memory. The issue is that Makefile.gnu isn't passing the appropriate -D EU_MANAGED_MEM flag, unlike Makefile.wat
Hallo
Do i have to file a ticket for this?
Andreas
4. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by jimcbrown (admin) Feb 09, 2014
- 1911 views
Hallo
this option seems to be ignored on windows.
At least the binary still displays 'Using System Memory'
Andreas
That sounds like a bug. Looking at the source code, however, I think the bug is limited to an inaccurate display - it says system memory but is really using managed memory. The issue is that Makefile.gnu isn't passing the appropriate -D EU_MANAGED_MEM flag, unlike Makefile.wat
Hallo
Do i have to file a ticket for this?
Andreas
Probably.
5. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by SDPringle Feb 12, 2014
- 1866 views
By design UNIX systems builders cannot enable this feature. By accident, this means MINGW compiled has this disabled too. I argued that system builders should have this choice even if we are not using Windows but I couldn't convince the other developers at the time.
Managed memory arguably bloats the memory use of your program, but it prevents calls to free/malloc so it could be faster. Managed memory is absolutely required when malloc may not return 8-byte aligned addresses (internally EUPHORIA relies on this). In UNIX, no known platform has a malloc that doesn't return 8-byte aligned addresses, so it is meant to be disabled for UNIX by disabling it for GNU make.
Shawn Pringle
6. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by jimcbrown (admin) Feb 12, 2014
- 1827 views
By accident, this means MINGW compiled has this disabled too.
This is not true. It is possible to build binaries today with MinGW that run on Windows 9x, as long as you enable managed memory and align4. The ONLY issue is that the binary incorrectly reports itself as using system memory, even though it has been compiled with and is actually using managed memory.
By design UNIX systems builders cannot enable this feature.
I argued that system builders should have this choice even if we are not using Windows but I couldn't convince the other developers at the time.
Agreed.
Managed memory arguably bloats the memory use of your program, but it prevents calls to free/malloc so it could be faster. Managed memory is absolutely required when malloc may not return 8-byte aligned addresses (internally EUPHORIA relies on this). In UNIX, no known platform has a malloc that doesn't return 8-byte aligned addresses,
I think it was because the overhead of align4 made no sense on UNIX, and no one had solid statistics of the speed benefits of using managed memory at the time. This was before managed memory and align4 were separated out.
so it is meant to be disabled for UNIX by disabling it for GNU make.
IIRC it's actually EUNIX in the source code that disables it, not a GNU makefile setting. (EUNIX doesn't apply when building with MinGW, so...)
7. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by SDPringle Feb 12, 2014
- 1814 views
I think it was because the overhead of align4 made no sense on UNIX, and no one had solid statistics of the speed benefits of using managed memory at the time. This was before managed memory and align4 were separated out.
Generally speaking less code is faster but to decide this a priori is false economy. With managed memory you cache the memory in the same process. With simple malloc, the OS gets involved for each call to EMalloc and EFree. Memory wise simple malloc is more efficient. Process cycle-wise remains to be seen. Tests that prove on way over another on one machine might have opposite results on another.
Shawn Pringle
8. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by ne1uno Feb 13, 2014
- 1785 views
Hallo
this option seems to be ignored on windows.
At least the binary still displays 'Using System Memory'
Andreas
That sounds like a bug. Looking at the source code, however, I think the bug is limited to an inaccurate display - it says system memory but is really using managed memory. The issue is that Makefile.gnu isn't passing the appropriate -D EU_MANAGED_MEM flag, unlike Makefile.wat
I also believe that eu* is being compiled managed mem on windows, just not properly displayed. should not be that difficult to fix.
It could be improper flags passed in the Makefile as well. I had looked into this and have mentioned it a few times in posts or bug reports as an aside, I didn't want to mess around in that area personally. I suspect this is at least partially why the bug persists if anyone else even noticed it.
I have used both Managed mem and System mem and they appear to handle memory use slightly differently. there should be some kind of quick test in the initiate manually directory to verify the build does what it claims to with memory on windows.
9. Re: --managed-mem Enable managed memory. Used on Windows.
- Posted by SDPringle Feb 13, 2014
- 1821 views
Managed mem vs. system mem effects are not noticeable in most programs. If you can fool EUPHORIA into calling a customized version of free that keeps a counter that you can later display, then you can write a program that does this. Such code is OS dependent.