I got some things working, but now I am stuck with:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
What to do?
I got some things working, but now I am stuck with:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
What to do?
Bump NPAGEDYN?
In article <10gqr6c$3saak$1@dont-email.me>,
=?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
I got some things working, but now I am stuck with:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
What to do?
Contact your authorized D|I|G|I|T|A|L representative to purchase more
memory cards. Do not, under any circumstances, call Clearpoint or
Dataram or any other unauthorized and probably communist vendors of
memory products.
On 12/4/25 02:21, Arne Vajh|+j wrote:
I got some things working, but now I am stuck with:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
What to do?
Bump NPAGEDYN?
More likely to be PAGEDYN rather than NPAGEDYN.
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
No idea what 00098054 and 00098043 means - can't find
those message definitions anywhere.
Am 04.12.2025 um 15:23 schrieb Arne Vajh|+j:
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
No idea what 00098054 and 00098043 means - can't find
those message definitions anywhere.
AXPVMS $ msgtxt %x00098043
%TRACE-I-END, end of TRACE stack dump
AXPVMS $ msgtxt %x00098054
%TRACE-F-TRACEBACK, symbolic stack dump follows
Try bumping PGFLQUOTA, if it's a process memory problem.
Monitor the running process with $ SHOW PROC/QUOTA/ID=xxx and look for
...
-aPaging file quota:-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 494208-a Subprocess quota:-a-a-a-a-a-a-a 10
...
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
On 2025-12-04, Arne Vajh|+j <arne@vajhoej.dk> wrote:
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
Resource leak ?
On 12/4/2025 1:29 PM, Simon Clubley wrote:
On 2025-12-04, Arne Vajhoj <arne@vajhoej.dk> wrote:
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
Resource leak ?
Definitely.
But the code is rather simple.
Shortest reproducer:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cma.h>
void *run(void *p)
{
if(p != NULL) printf("arg pointer = %p\n", p);
return NULL;
}
int main()
{
cma_t_thread t;
cma_t_exit_status stat;
void *p;
cma_init();
int n = 0;
while(1)
{
cma_thread_create(&t, &cma_c_null, run, NULL);
cma_thread_join(&t, &stat, &p);
if(p != NULL) printf("return pointer = %p\n", p);
n++;
printf("%d\n", n);
}
return 0;
}
That code is not doing much.
With this code I get the problem after 16431 good iteration
and a stack trace.
1) What is the reason for using the CMA interface instead of the pthread interface ? If there is no specific reason, perhaps rewriting it as a pthreads application might give some clues.
2) I assume cma_thread_create() and cma_thread_join() both return status codes ? (pthread does). Try capturing them and displaying them.
3) Have you tried my suggestion to put 5 second pauses in the code so
you have a chance to try and find out which resource is being consumed ?
On 12/4/2025 1:29 PM, Simon Clubley wrote:
On 2025-12-04, Arne Vajh|+j <arne@vajhoej.dk> wrote:
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
Resource leak ?
Definitely.
But the code is rather simple.
Shortest reproducer:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cma.h>
void *run(void *p)
{
-a-a-a if(p != NULL) printf("arg pointer = %p\n", p);
-a-a-a return NULL;
}
int main()
{
-a-a-a cma_t_thread t;
-a-a-a cma_t_exit_status stat;
-a-a-a void *p;
-a-a-a cma_init();
-a-a-a int n = 0;
-a-a-a while(1)
-a-a-a {
-a-a-a-a-a-a-a cma_thread_create(&t, &cma_c_null, run, NULL);
-a-a-a-a-a-a-a cma_thread_join(&t, &stat, &p);
-a-a-a-a-a-a-a if(p != NULL) printf("return pointer = %p\n", p);
-a-a-a-a-a-a-a n++;
-a-a-a-a-a-a-a printf("%d\n", n);
-a-a-a }
-a-a-a return 0;
}
On 12/4/2025 2:12 PM, Arne Vajh|+j wrote:
On 12/4/2025 1:29 PM, Simon Clubley wrote:
On 2025-12-04, Arne Vajh|+j <arne@vajhoej.dk> wrote:
A sequence of:
cma_thread_create
cma_mutex_lock
cma_mutex_unlock
cma_thread_join
and after a little over 10000 iterations:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
Resource leak ?
Definitely.
But the code is rather simple.
Shortest reproducer:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cma.h>
void *run(void *p)
{
-a-a-a if(p != NULL) printf("arg pointer = %p\n", p);
-a-a-a return NULL;
}
int main()
{
-a-a-a cma_t_thread t;
-a-a-a cma_t_exit_status stat;
-a-a-a void *p;
-a-a-a cma_init();
-a-a-a int n = 0;
-a-a-a while(1)
-a-a-a {
-a-a-a-a-a-a-a cma_thread_create(&t, &cma_c_null, run, NULL);
-a-a-a-a-a-a-a cma_thread_join(&t, &stat, &p);
Insert:
cma_thread_detach(&t);
and memory gets freed.
I don't know if this is intentional.
Usually join is sufficient.
In article <69320352$0$673$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
Usually join is sufficient.
With pthreads, yes. Evidently not with CMA.
Why bother with CMA, anyway? Just use pthreads?
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
No idea what 00098054 and 00098043 means - can't find
those message definitions anywhere.
On 12/4/25 15:23, Arne Vajh|+j wrote:
%SYSTEM-F-INSFMEM, insufficient dynamic memory
%TRACE-F-NOMSG, Message number 00098054
%TRACE-I-NOMSG, Message number 00098043
No idea what 00098054 and 00098043 means - can't find
those message definitions anywhere.
$ set message sys$message:DBGTBKMSG
You probably did not get the message text, because this message file
could not be (merge) activated: because of the resource problem.
In article <69320352$0$673$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
Insert:
cma_thread_detach(&t);
and memory gets freed.
I don't know if this is intentional.
It appears so. From the extant documentation I could find about
CMA threads, in the description of, `cma_thread_create`:
|The thread object exists until the cma_thread_detach routine is
|called **and** the thread terminates, whichever occurs last.
[Emphasis added; note the "and" there.]
Usually join is sufficient.
With pthreads, yes. Evidently not with CMA.
On 12/4/2025 2:49 PM, Simon Clubley wrote:
1) What is the reason for using the CMA interface instead of the pthread
interface ? If there is no specific reason, perhaps rewriting it as a
pthreads application might give some clues.
I already have working pthreads code.
I wanted to do the same with cma.
On 2025-12-05, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
In article <69320352$0$673$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
Usually join is sufficient.
With pthreads, yes. Evidently not with CMA.
Why bother with CMA, anyway? Just use pthreads?
In his reply to me when I asked the same question, Arne said he had
a working phtreads version, but he wanted to try CMA as well because
it was there.
I must admit I've been guilty of the same thing at times. :-)
PS: Sometimes I even learnt something new I was not expecting...
On 12/5/2025 12:15 PM, Dan Cross wrote:
In article <69320352$0$673$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
Insert:
cma_thread_detach(&t);
and memory gets freed.
I don't know if this is intentional.
It appears so. From the extant documentation I could find about
CMA threads, in the description of, `cma_thread_create`:
|The thread object exists until the cma_thread_detach routine is
|called **and** the thread terminates, whichever occurs last.
[Emphasis added; note the "and" there.]
So it is documented, which obviously make it intentional.
Usually join is sufficient.
First a correction of myself.
join is sufficient for GC languages.
For non-GC languages join + destructor is sufficient.
But nobody is surprised that their C++ code is leaking
memory if they forget:
delete t;
With pthreads, yes. Evidently not with CMA.
It is a weird usage if we look at what a thread_detach
function does.
function thread_detach() {
// test inserted in V1.1 to handle cases where the thread completed
before this function got called
if(thread is terminated) {
call thread_free()
return
}
// change state
state = detached // any attempts to join will now fail
// setup free at termination
on_termination_handler = function {
call thread_free()
}
}
Calling this function after a join that ensures thread
is terminated will obviously free.
But why not expose the thread_free function?
Or let thread_join call thread_free, because thread_join
knows that the thread is terminated before it completes.
On 12/4/2025 3:59 PM, Arne Vajh|+j wrote:
On 12/4/2025 2:49 PM, Simon Clubley wrote:
1) What is the reason for using the CMA interface instead of the pthread >>> interface ? If there is no specific reason, perhaps rewriting it as a
pthreads application might give some clues.
I already have working pthreads code.
I wanted to do the same with cma.
There are something in cma not present in pthread.
The cma API comes with the cma_lib_queue_* functions.
Doing similar to java.util.concurrent.BlockingQueue
if you are familiar with that.
In article <69345887$0$663$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
There are something in cma not present in pthread.
The cma API comes with the cma_lib_queue_* functions.
Presumably this doesn't exist in pthreads because it's simple to
do oneself using the tools that interface gives you (mutexes and
condition variables, specifically).
Nothing in the CMA lib APIs strikes me as particularly worth
adding it to the interface, and one can imagine all sorts of
enhancements that it just doesn't provide (prioritization;
fairness; sending by value instead of reference, etc).
Doing similar to java.util.concurrent.BlockingQueue
if you are familiar with that.
Well, not quite. That's generic over some element type, E. The
CMA library functions, and my own trivial example, just use a
pointer, which is rather different.
On 12/8/2025 3:55 PM, Dan Cross wrote:
In article <69345887$0$663$14726298@news.sunsite.dk>,
Arne Vajh|+j <arne@vajhoej.dk> wrote:
There are something in cma not present in pthread.
The cma API comes with the cma_lib_queue_* functions.
Presumably this doesn't exist in pthreads because it's simple to
do oneself using the tools that interface gives you (mutexes and
condition variables, specifically).
It is almost always possible to go DIY.
But why? If someone else is willing to do it, then it is great!
Nothing in the CMA lib APIs strikes me as particularly worth
adding it to the interface, and one can imagine all sorts of
enhancements that it just doesn't provide (prioritization;
fairness; sending by value instead of reference, etc).
Don't let perfect be the enemy of good.
Doing similar to java.util.concurrent.BlockingQueue
if you are familiar with that.
Well, not quite. That's generic over some element type, E. The
CMA library functions, and my own trivial example, just use a
pointer, which is rather different.
The Java version is more type safe than the C version.
But I think that matches the preference of both Java and C
people.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 22:46:44 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 186,546 |
| Posted today: | 1 |