Insufficient memory for signal/pin

More
8 years 3 months ago #114782 by andypugh
I think you need to recompile everything that uses that macro:

github.com/LinuxCNC/linuxcnc/search?q=HA...&unscoped_q=HAL_SIZE

So it might just be simpler to recompile everything.

Please Log in to join the conversation.

More
8 years 3 months ago #114783 by andypugh
But: if your HAL is that big, what is it doing?

Maybe you could increase efficiency and decrease pin usage by combining some of your HAL in to custom HAL components (which are pretty easy to compile, and you don't need the LinuxCNC source to do so)

Please Log in to join the conversation.

More
8 years 3 months ago #114793 by tommylight

andypugh wrote: But: if your HAL is that big, what is it doing?


Was wondering the same thing, how big does it have to be ?
Or where is that hal ? Can you upload it here ?

Please Log in to join the conversation.

More
8 years 2 months ago #116181 by Nico2017
Hi,
this is what I get when I run halcmd status when I manage to run my files on the edge of memory.
halcmd status
HAL locking status:
current lock value 0 (00)
HAL_LOCK_NONE - nothing is locked
HAL memory status
used/total shared memory: 305348/307200
active/recycled components: 34/0
active/recycled pins: 2210/0
active/recycled parameters: 565/0
active/recycled aliases: 0/0
active/recycled signals: 296/0
active/recycled functions: 193/0
active/recycled threads: 1/0

Adding one pin to the program generate the hal memory limit error:
HAL: ERROR: insufficient memory for signal 'testsignal'
Shutting down and cleaning up LinuxCNC...

So I guess the issue is the used/total shared memory: 305348/307200. Is there any way to extend this limit without recompiling the whole linuxcnc? I am struggling to compile a linuxcnc version where I would have modified the .hal memory limit accordingly.

Thank you,
Nicolas

Please Log in to join the conversation.

More
8 years 2 months ago #116183 by andypugh
I think this is a different problem, but it would so no harm to follow the instructions in 5.1 here:
linuxcnc.org/docs/devel/html/code/buildi..._locked_memory_limit

Please Log in to join the conversation.

More
8 years 2 months ago #116184 by dgarrett
Code:
# using git Run-in-place build for current 2.7 (at commit:37940e6) $ halrun halcmd: status HAL locking status: current lock value 0 (00) HAL_LOCK_NONE - nothing is locked HAL memory status used/total shared memory: 312/307200 ... $ grep -H HAL_SIZE hal_priv.h hal_priv.h:#define HAL_SIZE (75*4096) $ echo $((75*4096)) 307200 # edit hal_priv.h to increase HAL_SIZE $ git diff hal_priv.h -#define HAL_SIZE (75*4096) +#define HAL_SIZE (100*4096) # run make to incorporate change to hal_priv.h ... $ halrun halcmd: status HAL locking status: current lock value 0 (00) HAL_LOCK_NONE - nothing is locked HAL memory status used/total shared memory: 312/409600 ...

Please Log in to join the conversation.

More
7 years 5 months ago #134547 by Nico2017
Hi,
just for the records, after modifying the define HAL_SIZE in linxucnc-dev/src/hal/hal_priv.h I did
for RIP modification only
cd src/
make clean
./autogen.sh
./configure
make -j4 ( j4=quad processor speed )
sudo make setuid.

For building debian package to make the update available everywhere
> cd linuxcnc-dev/debian
> ./configure uspace
> cd ..
> dpkg-buildpackage -b -uc
Then dpkg -i linuxcnc-uspace.. ..deb
Then dpkg -i linuxcnc-uspace-dev... .deb
This even keep your local config files installed before the re-installation on top of the new deb files.
This also does not affect any Ethercat component already installed and working with linuxcnc

Thanks a lot to @dgarrett for the instructions.

Nicolas

Please Log in to join the conversation.

More
6 years 9 months ago #155471 by Nico2017
Hi all,
I am just wondering up to which value the HAL memory could be extended and if there is a way to work out this value. Not that I want to be on the maximum edge but I would like to know how far I am from this theoretical limit.

Has it got an impact on the realtime process and could it lead to memory bleeding if this value is set too high?
Thank you,

Nicolas

Please Log in to join the conversation.

More
6 years 9 months ago #155515 by HalaszAttila
Hello,

it is a good question. I use a compiled Linuxcnc with
#define HAL_SIZE (200*4096) - config, without any problem. But the higher limit is interesting for me.

Please Log in to join the conversation.

More
6 years 8 months ago #156543 by Nico2017
Hi,
I am also wondering while reading the hal_priv.h file about

/* IMPORTANT: If any of the structures in this file are changed, the
version code (HAL_VER) must be incremented, to ensure that
incompatible utilities, etc, aren't used to manipulate data in
shared memory

Does this mean we have to modify the HAL_VER when extending the HAL memory by modifying:
Code:
#define HAL_STACKSIZE 16384 /* realtime task stacksize */ #define HAL_SIZE (75*4096)

Thank you,
Nicolas

Please Log in to join the conversation.

Time to create page: 0.126 seconds
Powered by Kunena Forum