bb44e5c842
The system_profiler command used to determine the total memory on darwin systems performs an "Activation Lock" check. This can produce a delay in returning total memory. I began experiencing delays of around 10 seconds. Switching from system_profiler to sysctl to calculate total memory bypasses the "Activation Lock" check / timeout scenario. Results of "time" command using system_profiler: system_profiler SPHardwareDataType 0.17s user 0.23s system 3% cpu 10.165 total grep -a "Memory:" 0.00s user 0.00s system 0% cpu 10.164 total awk '{print $2 $3}' 0.00s user 0.00s system 0% cpu 10.163 total Results of "time" command using sysctl: sysctl -n hw.memsize 0.00s user 0.00s system 83% cpu 0.004 total awk '{print $0/1024/1024/1024 " GB"}' 0.00s user 0.00s system 86% cpu 0.004 total |
||
---|---|---|
.. | ||
attached_clients.sh | ||
battery.sh | ||
continuum.sh | ||
cpu_info.sh | ||
cwd.sh | ||
dracula.sh | ||
fossil.sh | ||
git.sh | ||
gpu_power.sh | ||
gpu_ram_info.sh | ||
gpu_usage.sh | ||
hg.sh | ||
kubernetes_context.sh | ||
mpc.sh | ||
network.sh | ||
network_bandwidth.sh | ||
network_ping.sh | ||
network_vpn.sh | ||
ram_info.sh | ||
spotify-tui.sh | ||
ssh_session.sh | ||
synchronize_panes.sh | ||
terraform.sh | ||
tmux_ram_info.sh | ||
utils.sh | ||
weather.sh | ||
weather_wrapper.sh |