<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: memory issues</title>
		<link>http://www.k-wave.org/forum/topic/memory-issues</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:06:23 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/memory-issues" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "memory issues"</title>
			<link>http://www.k-wave.org/forum/topic/memory-issues#post-8366</link>
			<pubDate>Thu, 16 Dec 2021 10:32:33 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8366@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Anastasiia,&#60;/p&#62;
&#60;p&#62;In addition to the suggestions from vich, you could try removing &#60;code&#62;sensor.frequency_response&#60;/code&#62; and applying this yourself using &#60;code&#62;gaussianFilter&#60;/code&#62; after the simulation has completed. That way a lot of memory will be freed. In the extreme case, you could clear everything except your sensor data. This would also allow you to switch to using the C++ code, which will make the simulations faster also.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vich on "memory issues"</title>
			<link>http://www.k-wave.org/forum/topic/memory-issues#post-8350</link>
			<pubDate>Fri, 19 Nov 2021 16:55:32 +0000</pubDate>
			<dc:creator>vich</dc:creator>
			<guid isPermaLink="false">8350@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Anastasiia,&#60;/p&#62;
&#60;p&#62;Regarding your first post: the simulation should indeed appear to be complete, as the main computational loop in kspaceFirstOrder3D.m, which iterates over time steps, completes before the error you have shown. The video file is also fully saved to disk (lines 1195, 1229) before the error is encountered. (I assume you are using v.1.3, based on your error messages.)&#60;/p&#62;
&#60;p&#62;I am not entirely sure how many (modified) copies of &#60;code&#62;sensor_data.p&#60;/code&#62; are kept around in memory while the critical line 81 in gaussianFilter.m runs. I would suspect the original version (in &#60;code&#62;kspaceFirstOrder3D()&#60;/code&#62; scope), plus one or two versions in &#60;code&#62;gaussianFilter()&#60;/code&#62; scope (one to hold the temporary results of line 81, and perhaps another to be passed as the input to &#60;code&#62;fft()&#60;/code&#62;, though I'm not sure whether this second copy is the same as &#60;code&#62;kspaceFirstOrder3D()&#60;/code&#62;'s version or not), plus an indeterminate number of versions used for intermediate steps in the calculation (I am not sure how MATLAB optimizes all those chained commands). You may want to run an empirical test with a smaller simulation and monitor your RAM usage (with top(1), taskmgr.exe, etc.), in terms of multiples of &#60;code&#62;sensor_data.p&#60;/code&#62;, to see how the program behaves over time. Afterwards, you'll need to reduce your simulation size so that even at peak RAM usage your machine can handle the necessary computations.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anastasiia on "memory issues"</title>
			<link>http://www.k-wave.org/forum/topic/memory-issues#post-8301</link>
			<pubDate>Fri, 27 Aug 2021 11:56:37 +0000</pubDate>
			<dc:creator>Anastasiia</dc:creator>
			<guid isPermaLink="false">8301@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I ran another simulation, with a smallet time step, compared to the one described above(now i have 7089 time points) and i get the following ''Error in kspaceFirstOrder3D (line 976)&#60;br /&#62;
                    - absorb_eta .* real(ifftn( absorb_nabla2 .* fftn(rhox + rhoy + rhoz) )) ...''.&#60;br /&#62;
Again a memory issue.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anastasiia on "memory issues"</title>
			<link>http://www.k-wave.org/forum/topic/memory-issues#post-8297</link>
			<pubDate>Mon, 16 Aug 2021 17:02:00 +0000</pubDate>
			<dc:creator>Anastasiia</dc:creator>
			<guid isPermaLink="false">8297@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Bradley,&#60;br /&#62;
I have just run a simulation with a 306×306×1320 space grid (dx=dy=dz: 8.3333e-05) and a t_array: [1×9463 double]. i simulate a circular pressure source emitting a 20-cycle tone burst at 4.5 MHz.&#60;br /&#62;
After the message that the simulation has been completed(''simulation completed in 81hours 47min 35.9105s'') I get the following error:&#60;br /&#62;
''Error using ifft&#60;br /&#62;
Out of memory. Type &#34;help memory&#34; for your options.&#60;/p&#62;
&#60;p&#62;Error in gaussianFilter (line 81)&#60;br /&#62;
signal = real(ifft(ifftshift(...&#60;/p&#62;
&#60;p&#62;Error in kspaceFirstOrder3D (line 1345)&#60;br /&#62;
    sensor_data.p = gaussianFilter(sensor_data.p, 1/kgrid.dt, sensor.frequency_response(1),&#60;br /&#62;
    sensor.frequency_response(2));''&#60;br /&#62;
And the strange part about this is that the video with the wave propagation has still been recorded, so it seems like the simulation has indeed been completed. Is there perhaps some way to retrieve this data? and what would be your advice on calculating if there is enough memory beforehand? I am somewhat far from computer simulations so my apologies for the stupid question.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
