<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Fullscreen Window Huge Memory Leak</title>
		<link>http://www.allegro.cc/forums/view/613588</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 03 Dec 2013 18:46:36 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Looking at my program in task manager (on Windows 7), I noticed that every time I toggle windowed fullscreen, the memory of the program jumps up significantly. It jumps up by around 27 mb each time I toggle to and from windowed fullscreen, and never goes back down.</p><p>If I switch in and out until the program uses more than 512 mb, it crashes! It only takes about 16 toggles before crashing</p><p>The only thing I do when toggling is call this:<br /><span class="source-code"><a href="http://www.allegro.cc/manual/al_toggle_display_flag"><span class="a">al_toggle_display_flag</span></a><span class="k2">(</span>display, ALLEGRO_FULLSCREEN_WINDOW, fullscreen<span class="k2">)</span><span class="k2">;</span></span></p><p>Could it be creating a new backbuffer bitmap and not destroying the old one?</p><p>EDIT: This happens in openGL mode, it doesn&#39;t seem to occur in direct3d. That being said I&#39;m using openGL, so switching is not a solution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ph03nix)</author>
		<pubDate>Mon, 02 Dec 2013 18:55:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not able to solve this problem myself, but I know what kind of information the people who do work on Allegro will want to know:</p><p>1. What version of Allegro are you using?</p><p>2. Does the problem still occur in other versions of Allegro, including the latest 5.1.x version?</p><p>3. If you close out the video mode entirely using al_destroy_display() and create a new one, does the memory leak still happen?</p><p>OpenGL has something special called Framebuffer Objects (FBOs) that Allegro manages internally. It&#39;s possible something about calling al_toggle_display_flag() isn&#39;t properly handling these. Again though, I don&#39;t work on Allegro so I couldn&#39;t say for certain if it&#39;s related to this, but I know FBOs have been a source of problems in the past with the OpenGL side of things.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kris Asick)</author>
		<pubDate>Mon, 02 Dec 2013 19:14:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>1. I&#39;m using 5.0.10</p><p>2. I tried it in 5.1.7 as well, the problem persists. It also happens if ALLEGRO_OPENGL_3_0 is turned on.</p><p>3. Destroying and creating the display causes the problem to go away! However it makes the application run very slowly. I&#39;ve heard I have to reload all of the graphics to put them into video memory, however before doing this I&#39;d like to know if there&#39;s a better way.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ph03nix)</author>
		<pubDate>Mon, 02 Dec 2013 19:29:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/613588/993489#target">ph03nix</a> said:</div><div class="quote"><p>It also happens if ALLEGRO_OPENGL_3_0 is turned on.</p></div></div><p>You probably already know this, but just in case you don&#39;t, ALLEGRO_OPENGL_3_0 is just a modifier for ALLEGRO_OPENGL. You need ALLEGRO_OPENGL to actually use Opengl. without it you get D3D.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 02 Dec 2013 20:44:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, I meant opengl and opengl3 set on.</p><p>So is this a bug in allegro? Should I actually be destroying the display, or is there something else I can do?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ph03nix)</author>
		<pubDate>Tue, 03 Dec 2013 18:22:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It may be a bug in allegro. It may be keeping the temporary memory bitmaps around after attempting to reupload them on the resize (essentially a resize completely re-creates the context, which needs to reupload everything).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Tue, 03 Dec 2013 18:45:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Definitely sounds like a bug.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 03 Dec 2013 18:46:36 +0000</pubDate>
	</item>
</rss>
