<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/memory.c, branch v2.5.2</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>updated copyright to 2026</title>
<updated>2026-01-01T06:59:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>rhaberkorn@fmsbw.de</email>
</author>
<published>2026-01-01T06:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=c2feb2a6f71fc9adb20226fb3c2260c236e974e0'/>
<id>c2feb2a6f71fc9adb20226fb3c2260c236e974e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fully support NetBSD with its native libcurses</title>
<updated>2025-08-21T23:48:24+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-08-11T08:56:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=f740ad3774c1adc7844451dd561c7de143766635'/>
<id>f740ad3774c1adc7844451dd561c7de143766635</id>
<content type='text'>
* It requires a forced refresh on startup (even though that should be the
  default). Otherwise, it wouldn't print the info line correctly.
* Redirect stdin and pass it to newterm() to fix key queuing.
  Probably necessary for supporting ncurses on NetBSD as well.
* Avoid doupdate() if screen is too small: fixes crashes for very
  small windows.
* Updated Scintilla: There were some implicit typing assumptions,
  that are broken by this platform.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It requires a forced refresh on startup (even though that should be the
  default). Otherwise, it wouldn't print the info line correctly.
* Redirect stdin and pass it to newterm() to fix key queuing.
  Probably necessary for supporting ncurses on NetBSD as well.
* Avoid doupdate() if screen is too small: fixes crashes for very
  small windows.
* Updated Scintilla: There were some implicit typing assumptions,
  that are broken by this platform.
</pre>
</div>
</content>
</entry>
<entry>
<title>FreeBSD: enable dlmalloc by default (--enable-malloc-replacement)</title>
<updated>2025-07-20T11:06:57+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-07-20T10:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=2ed6c3d1afbe33459cde8855299d3c327ffa30dc'/>
<id>2ed6c3d1afbe33459cde8855299d3c327ffa30dc</id>
<content type='text'>
* After re-benchmarking the performance, I in fact detected a 20-25% speedup if
  memory limiting is active. Both using `time` and the builtin monotic timer ::^B.
  When memory limiting is disabled, there is no detectable difference to jemalloc.
  The following test case was used:
  sciteco -e '::^BUs 100000&lt;@^U[^E\a]"^E\a" %a&gt; ::^B-Qs='
* I also played around with getrusage(), but it doesn't seem to be a viable
  API for detecting the currently used RSS, i.e. it does not allow recovering
  from OOMs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* After re-benchmarking the performance, I in fact detected a 20-25% speedup if
  memory limiting is active. Both using `time` and the builtin monotic timer ::^B.
  When memory limiting is disabled, there is no detectable difference to jemalloc.
  The following test case was used:
  sciteco -e '::^BUs 100000&lt;@^U[^E\a]"^E\a" %a&gt; ::^B-Qs='
* I also played around with getrusage(), but it doesn't seem to be a viable
  API for detecting the currently used RSS, i.e. it does not allow recovering
  from OOMs.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2025</title>
<updated>2025-01-12T23:39:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-01-12T23:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=d842eaee19e2723f845d4b8314a230cf68e82653'/>
<id>d842eaee19e2723f845d4b8314a230cf68e82653</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed some common typos: "ie." and "eg.", "ocur" instead of "occur"</title>
<updated>2024-11-18T13:30:59+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-11-18T13:28:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=52d66c5783d39a23027102c3087eac8ef1c0f02f'/>
<id>52d66c5783d39a23027102c3087eac8ef1c0f02f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>FreeBSD/jemalloc: fixed recovery after hitting memory limit</title>
<updated>2024-09-27T22:27:08+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-09-27T22:27:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=973e50d1f43b680863551f1aea30d88616488e84'/>
<id>973e50d1f43b680863551f1aea30d88616488e84</id>
<content type='text'>
* We now set opt.retain=false for the process, so jemalloc returns
  freed memory and the RSS decreases when recovering from memory limit hits.
  This should be safe at least on FreeBSD.
* Either the opt.retain option is new or I was previously testing
  this only on 32-bit systems.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* We now set opt.retain=false for the process, so jemalloc returns
  freed memory and the RSS decreases when recovering from memory limit hits.
  This should be safe at least on FreeBSD.
* Either the opt.retain option is new or I was previously testing
  this only on 32-bit systems.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed memory limiting if the process' memory usage is larger than 2GB and overflow checking</title>
<updated>2024-09-27T22:17:24+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-09-27T22:17:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=b3ae8e299517556ec6e9ad06d91353f5b66d0827'/>
<id>b3ae8e299517556ec6e9ad06d91353f5b66d0827</id>
<content type='text'>
* teco_memory_usage is now an unsigned integer.
* Unfortunately we currently rely on the variable being int-sized since we use
  atomic operations.
  This means on 64-bit systems, limiting will not work as expected if you set the limit larger
  than 4GB.
  Not sure whether this should be fixed.
* Calling teco_memory_check() with a non-null request-size was totally broken and could
  result in bogus failures.
  This is currently used exclusively for checking backwards searches.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* teco_memory_usage is now an unsigned integer.
* Unfortunately we currently rely on the variable being int-sized since we use
  atomic operations.
  This means on 64-bit systems, limiting will not work as expected if you set the limit larger
  than 4GB.
  Not sure whether this should be fixed.
* Calling teco_memory_check() with a non-null request-size was totally broken and could
  result in bogus failures.
  This is currently used exclusively for checking backwards searches.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2024</title>
<updated>2024-01-21T11:45:05+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2024-01-21T11:07:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=1cecf04656532e94e1fe9fe25460774324b2197c'/>
<id>1cecf04656532e94e1fe9fe25460774324b2197c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>introduced TECO_DEBUG_CLEANUP to mark destructors that should only be used for debug builds</title>
<updated>2023-07-03T01:27:49+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-07-03T01:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=41a02591b9d199a82bb24c23f3828102375137de'/>
<id>41a02591b9d199a82bb24c23f3828102375137de</id>
<content type='text'>
* There is cleanup that is not strictly necessary, because it only frees memory
  which is freed on program termination anyway.
* However, it helps to explicitly free everything for debugging memory leaks via Valgrind.
* The new macro reduces the number of #ifdef statements.
* On NDEBUG, the code of these functions will still be eliminated.
* If functions are referenced only from the destructor, there will be no unused function
  warnings, even in NDEBUG.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* There is cleanup that is not strictly necessary, because it only frees memory
  which is freed on program termination anyway.
* However, it helps to explicitly free everything for debugging memory leaks via Valgrind.
* The new macro reduces the number of #ifdef statements.
* On NDEBUG, the code of these functions will still be eliminated.
* If functions are referenced only from the destructor, there will be no unused function
  warnings, even in NDEBUG.
</pre>
</div>
</content>
</entry>
<entry>
<title>FreeBSD: fixed the poll-thread memory limiting implementation - it's the default now</title>
<updated>2023-05-14T01:58:28+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-05-14T01:58:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=96b60afcf4293db2e6841b58500fd12d0344e75f'/>
<id>96b60afcf4293db2e6841b58500fd12d0344e75f</id>
<content type='text'>
* On FreeBSD both the dlmalloc replacement and poll-thread via sysctl() work
  but the poll-thread has been benchmarked to be significantly faster,
  at least on my machine.
  You can still ./configure --enable-malloc-replacement of course.
* Interestingly, the RSS of the process visible via htop does not decrease
  after OOMs or command-line terminations - with neither of the implementations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* On FreeBSD both the dlmalloc replacement and poll-thread via sysctl() work
  but the poll-thread has been benchmarked to be significantly faster,
  at least on my machine.
  You can still ./configure --enable-malloc-replacement of course.
* Interestingly, the RSS of the process visible via htop does not decrease
  after OOMs or command-line terminations - with neither of the implementations.
</pre>
</div>
</content>
</entry>
</feed>
