[BUG] Massiv waste of RAM!

Feature requests, bug reports and related discussion
Post Reply
13 posts • Page 1 of 1
User avatar
Zom-B
1st Place 100
Posts: 4701
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

[BUG] Massiv waste of RAM!

Post by Zom-B » Thu May 10, 2007 6:01 am

Hey Ono...

I just did some tests with a mesh free scene to test my maximum resolution.
poorly such an empty scene rendered at 6000x6000 takes a Master buffer size of 411.987MB...

But at the time indigo has to display this rendered image in the output window,
it takes some extra 411.987MB just to display the image :shock: :shock: :shock:

how about displaying the saved png, and not the whole image from memory,
this should save some MB :wink:

I also found a bug, that image_save_period is linked to the display_period,
and the save period can't be smaler than the display period, so working around this issue
by setting the display_period to lets say 24 hours wouldn't save the image for 24 hours,
and possibly crashing if the extra display ram is to much for your system, because its taken before the image saves!
Attachments
max_resolution_test.igs
the test scene...
(1.85 KiB) Downloaded 337 times
polygonmanufaktur.de

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Thu May 10, 2007 6:37 am

what's about if indigo would only use a display buffer for the visible area. I mean if render is 6000x6000 but display window is only 800x600 it would be enogh to display the 800x600 part of the render image. Perhaps adding some scrollbars to the display window allows to scroll throug the rendered image (but of course will only be refreshed by nest display cycle or by a extra display/autorefresh). :?: :?: :?: The question is if you can calculate the reinhard tonemapping without having to create a display buffer for the hole image?

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Thu May 10, 2007 6:44 am

I think better solution would be to just use smaller image buffer. Like a custom size for image buffer or something like that.
The idea you are describing sounds very tricky and no go for me.

User avatar
Zom-B
1st Place 100
Posts: 4701
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Post by Zom-B » Thu May 10, 2007 7:00 am

You guys thinking much to complicated!

just display the rendered png file...
its much smaller than uncompressed RAW data!

I hope I'm right that this extra RAM taken is used for output display.

best proof for this is Violet:

just open a big igi file using violet, and take a look how much RAM it takes,
compare this to the RAM the scene needed after starting rendering!

because Ono doesn't enjoyed this whole GUI coding (he somewhere wrote this),
I'm sure he used the same code for image display in indigo & violet!
polygonmanufaktur.de

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Thu May 10, 2007 7:08 am

ZomB wrote: I hope I'm right that this extra RAM taken is used for output display.
Yep, you're right.
I'm a vray user in my daytime job and in Vray for large images we render either directly to disk without displaying the rendered image or using small preview image. So that's a common thing even for commercial renderer like Vray. Displaying large image takes RAM. Vray crashes if the image doesn't fit into memory. 8)

[edit]
I'm also not sure if i want to see compressed image as a final output while rendering.

zuegs
Posts: 380
Joined: Tue Jun 27, 2006 5:46 pm
Location: switzerland

Post by zuegs » Thu May 10, 2007 7:11 am

or with a option to disable display and PNG saving, so just export the igi file, so no tonemapping is needed and also no extra memory :wink:
[edit] oups suvakas sait it already

User avatar
Zom-B
1st Place 100
Posts: 4701
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Post by Zom-B » Thu May 10, 2007 7:26 am

suvakas wrote:I'm also not sure if i want to see compressed image as a final output while rendering.
png is a looseless image format.... don't worry!
the image just get clamped from HDR to 8bit:

The problem is that it seems indigo ( & violet) displays the full HDR range of colors,
but the output view should be clamped to standart 8bit,
because you can't see the extra colors!!!
polygonmanufaktur.de

User avatar
suvakas
3rd Place Winner
Posts: 2613
Joined: Mon Sep 04, 2006 11:08 pm
Location: Estonia
Contact:

Post by suvakas » Thu May 10, 2007 7:29 am

ZomB wrote: png is a looseless image format.... don't worry!
the image just get clamped from HDR to 8bit:
Ok. Gotcha !

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Thu May 10, 2007 7:41 am

ZomB wrote:
suvakas wrote:I'm also not sure if i want to see compressed image as a final output while rendering.
png is a looseless image format.... don't worry!
the image just get clamped from HDR to 8bit:

The problem is that it seems indigo ( & violet) displays the full HDR range of colors,
but the output view should be clamped to standart 8bit,
because you can't see the extra colors!!!
no, indigo and violet display the tonemapped images, in BITMAP format - as that is the ONLY format you can write to video memory (at least, when using the wx libraries)

Code: Select all

void ImageWindow::updateImage(const Image& image, int zoom_factor)
{
	{
	wxMutexLocker lock(wx_image_mutex);

	imageToWXImage(image, wx_image, zoom_factor);
	got_image = true;
	}

	this->SetVirtualSize(wxSize(image.getWidth()/zoom_factor, image.getHeight()/zoom_factor));

	this->Refresh();//invalidate window
}

void ImageWindow::OnPaint(wxPaintEvent& event)
{
	wxPaintDC paint_dc(this);
	DoPrepareDC(paint_dc);

	if(!got_image)
		return;

	wxBitmap bitmap;
	{
	wxMutexLocker lock(wx_image_mutex);
	bitmap = wxBitmap(wx_image, 24);
	}
	paint_dc.DrawBitmap(bitmap, 0, 0, false);
}
in this context, wx_image is of type wxImage (go look at wxwidgets.org for details), and this comes directly from the output of the tonemapping process (Image& image).

User avatar
Zom-B
1st Place 100
Posts: 4701
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Post by Zom-B » Thu May 10, 2007 9:26 am

Hey dougal,

I simply have no clue about coding (besides Action Script & html), I'm just a simple Indigo user,
who sometimes think to much about stuff he doesn't really understand :)

I tested to load a 6000x4500 rendered png Output in mspaint,
then I opened a compressed jpg of this file both took 240MB RAM to display.
My conclusion => mspaint displays images in "RAW" pixel data!

loading the 308MB igi file into violet took 724MB RAM reducing view size to 12.5% reduced the used memory to 646MB.
12.5% of the resolution takes mspaint 5MB RAM...
So I my conclusion => "hey...loading 308MB totally uncompressed data into memory, shouldn't take 641MB of RAM"
and so I blamed the indigo & Violet code for taking all my beloved RAM away :cry:

I'm a hobbit... not knowing by learning from the book, but by observe, and this was my conclusion...
polygonmanufaktur.de

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Thu May 10, 2007 9:44 am

yeah both Indigo and Violet probably leak memory like sieves... there isn't much explicit data removal - most is left to the OS's standard "garbage collection".

FakeShamus
Posts: 512
Joined: Wed May 02, 2007 11:34 am

Post by FakeShamus » Thu May 10, 2007 9:53 am

yeah, so how hard would it be to build in a close-able display window separate from the application window? I used to render with pov-ray a lot and that was a nice option - to close or re-open the display whenever you wanted.

User avatar
dougal2
Developer
Posts: 2532
Joined: Wed Nov 15, 2006 8:17 am
Location: South London

Post by dougal2 » Thu May 10, 2007 9:57 am

for indigo? use -nogui
for violet? wouldn't that defeat the point?

Post Reply
13 posts • Page 1 of 1