Insufficient memory for signal/pin

More
25 Jul 2018 00:25 #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 or Create an account to join the conversation.

More
25 Jul 2018 00:28 #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 or Create an account to join the conversation.

More
25 Jul 2018 05:13 #114793 by tommylight

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 or Create an account to join the conversation.

More
16 Aug 2018 20:49 - 16 Aug 2018 20:51 #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
Last edit: 16 Aug 2018 20:51 by Nico2017.

Please Log in or Create an account to join the conversation.

More
16 Aug 2018 21:02 #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 or Create an account to join the conversation.

More
16 Aug 2018 21:43 #116184 by dgarrett
# 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
...
The following user(s) said Thank You: Nico2017

Please Log in or Create an account to join the conversation.

More
22 May 2019 03:53 - 22 May 2019 04:29 #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
Last edit: 22 May 2019 04:29 by Nico2017. Reason: More precise answer

Please Log in or Create an account to join the conversation.

More
22 Jan 2020 22:57 #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 or Create an account to join the conversation.

More
23 Jan 2020 08:33 #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 or Create an account to join the conversation.

More
04 Feb 2020 21:39 - 04 Feb 2020 21:40 #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:
#define HAL_STACKSIZE 16384	/* realtime task stacksize */
#define HAL_SIZE  (75*4096)

Thank you,
Nicolas
Last edit: 04 Feb 2020 21:40 by Nico2017.

Please Log in or Create an account to join the conversation.

Time to create page: 0.109 seconds
Powered by Kunena Forum