Recent

Author Topic: Experience with Simply Memory Manager (openSimply)? Would you use it?  (Read 955 times)

Weja

  • Newbie
  • Posts: 5
Hello,
has anybody experience with openSimply https://opensimply.org respectively the simply memory manager https://opensimply.org/simply-memory-manager.php/? And/Or can say something about the project? I can't find any legal notice or something else which gives information about the person(s)/organisation behind the project. Would you use such code?

Can anyone of the free pascal team confirm that the following statement is correct:
Quote
Free Pascal's memory manager uses certain Windows functions for memory allocation and freeing, which cause fatal errors when large amount of memory is reusing multiple times. In addition, it runs in this case rather slow.
(https://opensimply.org/simply-memory-manager.php/)

Thank you for any reply  :)

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #1 on: April 17, 2023, 05:43:15 pm »
Legal: https://opensimply.org/free-simulation-software.php
Quote
OpenSIMPLY project is free simulation software that can be used under the terms of GNU General Public License GPLv3 and GNU Free Documentation License FDLv1.3. For using any part of OpenSIMPLY in a non-free product (including commercial use) an additional agreement has to be concluded.
regards
Andreas

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #2 on: April 17, 2023, 09:16:32 pm »
Well the fact that the site doesn't mention if the problem it tries to fix is with win32 or win64 (which are of course miles apart due to the larger virtual address space of 64-bit) make me somewhat doubtful.

It is also not clear for what scenarios it is better in a somewhat precise way. (e.g. with examples etc). It sounds like something tuned for one single application, not something universal.

But yes FPC uses windows functions to allocate memory, but only in large blocks. Smaller blocks are subdivided in the heapmanager.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #3 on: April 17, 2023, 09:44:57 pm »
Any memory manager on Windows must somehow get the memory from Windows...

Also their "how to use it" by putting it into the uses... It leaves out some important details.

And the "Lazarus may alloc mem before" is simply wrong. Any code in any app (and completely unrelated to Lazarus) can "use memory before", if their mem manager is incorrectly used. And such incorrect usage is likely to happen because of the vague description how to use it.

Quote
Place the SimplySMM unit the first in the "uses" statement.
But not any uses. The "uses" of the "program", and not the "uses" of some "unit".

And also, even better, use the correct command line param for FPC (I haven't bothered to look it up, but IIRC there is one).

----------
In any case: if it comes with sources => review it.
If not, given the dodgy claims and docs => I would certainly not use it.

Weja

  • Newbie
  • Posts: 5
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #4 on: April 19, 2023, 03:03:47 pm »
Thank you all for your answers!

At the end we did not have to use it because the "out of memory" problem we obtain before (only win32) could be solved also by correct memory handling within the code. Thus there was no reason for us to use another memory manager, anymore. 

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #5 on: April 19, 2023, 09:56:10 pm »
Also note, for a simpler memory manager, which is a bit faster and can be more memory efficient, you can also use the c-memory manager (simply include unit cmem as first include in your programs uses clause). This will then cause FPC to link against the systems libc and use the libc memory management functions instead

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Experience with Simply Memory Manager (openSimply)? Would you use it?
« Reply #6 on: April 19, 2023, 10:08:09 pm »
Most only-win32 problems are too liberal usage of TStringlist.text. (that requires double the memory  as it parses the single string into lines).

Switching memory manager might seem a solution, as another memory manager might have a slightly larger mem block available in this scenario. (usually more coincidence than anything else)

Solution: avoid tstringlist.(delimited)text on very large strings

 

TinyPortal © 2005-2018