Page 2 of 2
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Mon Aug 19, 2019 5:53 pm
by Linuxmusician01
raboof wrote:Linuxmusician01 wrote:On my current system (Mint 17.1 'Rebecca') I cannot install jack_control and it is not installed. But on my "toy" (antique little laptop) with Debian 10 'Buster' it is installed. How did y'all install jack_control?
I think Mint is Debian-based as well right? Then a useful tool is 'apt-file': 'apt-file jack_control' shows this tool is in the jackd2 package.
Thanks for the tip! I don't know why I couldn't find it in Mint (indeed, Debian based) before? It appears to be already installed on my system today (indeed, via the
jackd2 package).
P.S. How can I check on a running instance of Jack how many ports it is using?
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Tue Aug 20, 2019 3:00 pm
by merlyn
Nachei wrote:any idea of what they could mean?
They all happen within a second, so I think this is simply part of the process of shutting down JACK. Nothing to worry about.
Linuxmusician01 wrote:How can I check on a running instance of Jack how many ports it is using?
Go by what JACK was started with. As far as I know there isn't a way to get the JACK server to output this value. Also if you're using
jackd I don't think
jack_control will do anything. My understanding is that
jack_control writes to
~/.config/jack/conf.xml, which is only used by
jackdbus.
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Tue Aug 20, 2019 11:09 pm
by Nachei
merlyn wrote:Nachei wrote:any idea of what they could mean?
They all happen within a second, so I think this is simply part of the process of shutting down JACK. Nothing to worry about.
Yup, I've been using my system some more these days and it's rock solid (I'm able to record midi drums LIVE for the first time ever!), so I don't even pay attention to those messages any more... Thank you again merlyn.

Re: Getting "cannot allocate memory" error, although running in real time
Posted: Wed Aug 21, 2019 9:11 am
by Linuxmusician01
merlyn wrote:Nachei wrote:any idea of what they could mean?
They all happen within a second, so I think this is simply part of the process of shutting down JACK. Nothing to worry about.
Linuxmusician01 wrote:How can I check on a running instance of Jack how many ports it is using?
Go by what JACK was started with. As far as I know there isn't a way to get the JACK server to output this value. Also if you're using
jackd I don't think
jack_control will do anything. My understanding is that
jack_control writes to
~/.config/jack/conf.xml, which is only used by
jackdbus.
Thanks for the info. Always difficult to deal with: jack, dbus and jackd.
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Tue Aug 27, 2019 10:22 am
by merlyn
@Linuxmusician01 : You could work out how many ports are being used from the amount of memory JACK has allocated.
Code: Select all
$ ls -l /dev/shm
total 80444
-rw-r--r-- 1 merlyn merlyn 82280346 Aug 27 11:09 jack-1000-0
-rw-r--r-- 1 merlyn merlyn 1187 Aug 27 11:09 jack-1000-1
srwxr-xr-x 1 merlyn merlyn 0 Aug 27 11:09 jack_default_1000_0
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_catia
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_dbusapi
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_freewheel
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_system
-rw-rw-rw- 1 merlyn merlyn 70744 Aug 27 10:54 jack-shm-registry
82280346 bytes is 2048 ports.
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Tue Aug 27, 2019 10:46 am
by Linuxmusician01
merlyn wrote:@Linuxmusician01 : You could work out how many ports are being used from the amount of memory JACK has allocated.
Code: Select all
$ ls -l /dev/shm
total 80444
-rw-r--r-- 1 merlyn merlyn 82280346 Aug 27 11:09 jack-1000-0
-rw-r--r-- 1 merlyn merlyn 1187 Aug 27 11:09 jack-1000-1
srwxr-xr-x 1 merlyn merlyn 0 Aug 27 11:09 jack_default_1000_0
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_catia
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_dbusapi
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_freewheel
-rwxr-xr-x 1 merlyn merlyn 12 Aug 27 11:09 jack_sem.1000_default_system
-rw-rw-rw- 1 merlyn merlyn 70744 Aug 27 10:54 jack-shm-registry
82280346 bytes is 2048 ports.
Thanks! How do you come up with that number? Divide it by 40176?
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Tue Aug 27, 2019 11:31 am
by merlyn
17374746 bytes is 128 ports, so it's not mem = k * ports, it's something like mem = k * ports + c.
OK, I'll work it out
k * 128 + c = 17374746 --- (1)
k * 2048 + c = 82280346 --- (2)
(2) - (1)
1920 * k = 64905600
k = 33805
sub in (1)
c = 17374746 - 4327040 = 13047706
So the equation is : mem = 33805 * ports + 13047706
so
ports = (mem - 13047706)/33805
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Wed Aug 28, 2019 11:16 am
by Linuxmusician01
merlyn wrote:17374746 bytes is 128 ports, so it's not mem = k * ports, it's something like mem = k * ports + c.
OK, I'll work it out
k * 128 + c = 17374746 --- (1)
k * 2048 + c = 82280346 --- (2)
(2) - (1)
1920 * k = 64905600
k = 33805
sub in (1)
c = 17374746 - 4327040 = 13047706
So the equation is : mem = 33805 * ports + 13047706
so
ports = (mem - 13047706)/33805
Again: thanks! I'm a Master in physical chemistry so I appreciate equations very much. Irritating question once again (please forgive me): how did you come up w/ the number of 17374746?
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Thu Aug 29, 2019 11:58 am
by Linuxmusician01
By the way, on my Raspberry Pi running on Raspbian I got rid of the error "cannot allocate memory" by following the instructions
this link. Add to
/etc/security/limits.conf:
Code: Select all
your_user_name soft rtprio 90
your_user_name soft memlock unlimited
@audio hard rtprio 90
@audio hard memlock unlimited
@video hard rtprio 90
@video hard memlock unlimited
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Fri Aug 30, 2019 3:26 pm
by merlyn
Linuxmusician01 wrote:how did you come up w/ the number of 17374746?
It's from my verbose JACK log. See this post :
https://www.linuxmusicians.com/viewtopi ... 34#p109364. I could also have got it from
ls -l /dev/shm
I knew the number of ports from my Cadence settings.
Linuxmusician01 wrote:By the way, on my Raspberry Pi running on Raspbian I got rid of the error "cannot allocate memory" by following the instructions
this link. Add to
/etc/security/limits.conf:
Code: Select all
your_user_name soft rtprio 90
your_user_name soft memlock unlimited
@audio hard rtprio 90
@audio hard memlock unlimited
@video hard rtprio 90
@video hard memlock unlimited
The problem that @Nachei was having was that these changes had been made to
limits.conf and he was still getting 'cannot allocate memory'. It's a bug in
systemd 240 where user defined limits are ignored. It's still possible to lock memory but the bug means that there is a limit of around 50MB. 1024 ports involves around 47MB of memory, so 1024 ports works.
Re: Getting "cannot allocate memory" error, although running in real time
Posted: Fri Aug 30, 2019 3:29 pm
by Linuxmusician01
@Merlyn: thank you for the explanation!
