Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Parallel pool never releases used memory leading to instability

Parallel pool never releases used memory leading to instability

PuTI / 2025-01-16
Parallel pool never releases used memory leading to instability
Matlab News

Running code like:
rxs = rxsite("AntennaHeight",1.5, …
"Latitude", 38.9899587, "Longitude", -76.9353889);

for scenario = 1:2
switch scenario
% these are not meaningful paths
case 1
txPositions = [linspace(38.9857294, 38.9857294, 10000).’, linspace(-76.9442905, -76.9407240, 10000).’];
case 2
txPositions = [linspace(38.9895908, 38.9903186, 10000).’, linspace(-76.9432997, -76.9446669, 10000).’];
end

pm = propagationModel("raytracing");
data = [];
parfor point = 1:size(txPositions,1)
txs = txsite("AntennaHeight", 1.5, …
"Latitude", txPositions(1,point), "Longitude", txPositions(2,point), …
"TransmitterPower", 10);
rays = raytrace(txs, rxs, pm, "type", "power"); % rays is Na x Ns cell array
if ~isempty(rays{1}) % only ever 1 tx/1 rx
rayPower = 0;
% phasor sum of rec’d power
for rayPath = 1:numel(rays{1})
pWatts = 10^(-rays{1}(rayPath).PathLoss/10)*10;
rayPower = rayPower + pWatts*(cos(rays{1}(rayPath).PhaseShift) + 1i*sin(rays{1}(rayPath).PhaseShift));
end
% convert to RSS in dBm and resultant signal phase offset
RSS = 10*log10(abs(rayPower)/.001); % dBm
phaseOffset = angle(rayPower) ; % rads
% collate data
data = [samplePoints(step, 1), samplePoints(step, 2), RSS, phaseOffset];
end
end

close all force % this is an attempt to fix this issue
save("data.mat","data")
clear data
delete(gcp)

end
This code will spawn a transmitter, move it along a path, sample the RSS at a receiver then append that data into a list which gets saved. After that, the parallel pool is reinitialized and the data variable is cleared before starting the next scenario. The delete(gcp) line was from another about a similar issue which I cant find anymore – this helps but doens’t solve the problem.
Running this code, I would expect the memory usage to increase during a single scenario (which is what I see), but I would also expect to see memory usage drop considerably between scenarios. However, this code causes the memory usage to steadily increase across scenarios, regardless of if I delete the parallel pool and clear variables. This almost always results in MATLAB either locking up the computer or just crashing outright.
The issue never occurs on the first (or even the first few) scenario, but will always happen after some number have been run, so I know that the individual scenarios are totally fine.
Am I going about this wrong or is there something I should do to fix this? This issue is present on R2024b on Ubuntu22 and Win10.Running code like:
rxs = rxsite("AntennaHeight",1.5, …
"Latitude", 38.9899587, "Longitude", -76.9353889);

for scenario = 1:2
switch scenario
% these are not meaningful paths
case 1
txPositions = [linspace(38.9857294, 38.9857294, 10000).’, linspace(-76.9442905, -76.9407240, 10000).’];
case 2
txPositions = [linspace(38.9895908, 38.9903186, 10000).’, linspace(-76.9432997, -76.9446669, 10000).’];
end

pm = propagationModel("raytracing");
data = [];
parfor point = 1:size(txPositions,1)
txs = txsite("AntennaHeight", 1.5, …
"Latitude", txPositions(1,point), "Longitude", txPositions(2,point), …
"TransmitterPower", 10);
rays = raytrace(txs, rxs, pm, "type", "power"); % rays is Na x Ns cell array
if ~isempty(rays{1}) % only ever 1 tx/1 rx
rayPower = 0;
% phasor sum of rec’d power
for rayPath = 1:numel(rays{1})
pWatts = 10^(-rays{1}(rayPath).PathLoss/10)*10;
rayPower = rayPower + pWatts*(cos(rays{1}(rayPath).PhaseShift) + 1i*sin(rays{1}(rayPath).PhaseShift));
end
% convert to RSS in dBm and resultant signal phase offset
RSS = 10*log10(abs(rayPower)/.001); % dBm
phaseOffset = angle(rayPower) ; % rads
% collate data
data = [samplePoints(step, 1), samplePoints(step, 2), RSS, phaseOffset];
end
end

close all force % this is an attempt to fix this issue
save("data.mat","data")
clear data
delete(gcp)

end
This code will spawn a transmitter, move it along a path, sample the RSS at a receiver then append that data into a list which gets saved. After that, the parallel pool is reinitialized and the data variable is cleared before starting the next scenario. The delete(gcp) line was from another about a similar issue which I cant find anymore – this helps but doens’t solve the problem.
Running this code, I would expect the memory usage to increase during a single scenario (which is what I see), but I would also expect to see memory usage drop considerably between scenarios. However, this code causes the memory usage to steadily increase across scenarios, regardless of if I delete the parallel pool and clear variables. This almost always results in MATLAB either locking up the computer or just crashing outright.
The issue never occurs on the first (or even the first few) scenario, but will always happen after some number have been run, so I know that the individual scenarios are totally fine.
Am I going about this wrong or is there something I should do to fix this? This issue is present on R2024b on Ubuntu22 and Win10. Running code like:
rxs = rxsite("AntennaHeight",1.5, …
"Latitude", 38.9899587, "Longitude", -76.9353889);

for scenario = 1:2
switch scenario
% these are not meaningful paths
case 1
txPositions = [linspace(38.9857294, 38.9857294, 10000).’, linspace(-76.9442905, -76.9407240, 10000).’];
case 2
txPositions = [linspace(38.9895908, 38.9903186, 10000).’, linspace(-76.9432997, -76.9446669, 10000).’];
end

pm = propagationModel("raytracing");
data = [];
parfor point = 1:size(txPositions,1)
txs = txsite("AntennaHeight", 1.5, …
"Latitude", txPositions(1,point), "Longitude", txPositions(2,point), …
"TransmitterPower", 10);
rays = raytrace(txs, rxs, pm, "type", "power"); % rays is Na x Ns cell array
if ~isempty(rays{1}) % only ever 1 tx/1 rx
rayPower = 0;
% phasor sum of rec’d power
for rayPath = 1:numel(rays{1})
pWatts = 10^(-rays{1}(rayPath).PathLoss/10)*10;
rayPower = rayPower + pWatts*(cos(rays{1}(rayPath).PhaseShift) + 1i*sin(rays{1}(rayPath).PhaseShift));
end
% convert to RSS in dBm and resultant signal phase offset
RSS = 10*log10(abs(rayPower)/.001); % dBm
phaseOffset = angle(rayPower) ; % rads
% collate data
data = [samplePoints(step, 1), samplePoints(step, 2), RSS, phaseOffset];
end
end

close all force % this is an attempt to fix this issue
save("data.mat","data")
clear data
delete(gcp)

end
This code will spawn a transmitter, move it along a path, sample the RSS at a receiver then append that data into a list which gets saved. After that, the parallel pool is reinitialized and the data variable is cleared before starting the next scenario. The delete(gcp) line was from another about a similar issue which I cant find anymore – this helps but doens’t solve the problem.
Running this code, I would expect the memory usage to increase during a single scenario (which is what I see), but I would also expect to see memory usage drop considerably between scenarios. However, this code causes the memory usage to steadily increase across scenarios, regardless of if I delete the parallel pool and clear variables. This almost always results in MATLAB either locking up the computer or just crashing outright.
The issue never occurs on the first (or even the first few) scenario, but will always happen after some number have been run, so I know that the individual scenarios are totally fine.
Am I going about this wrong or is there something I should do to fix this? This issue is present on R2024b on Ubuntu22 and Win10. parallel computing MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

test one two three four
2025-05-20

test one two three four

Is it possible to make this tiny loop faster?
2025-05-19

Is it possible to make this tiny loop faster?

Solar Wind Battery Hybrid Integration
2025-05-19

Solar Wind Battery Hybrid Integration

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss