RunTime error DrawableD2D

Hello amazing Xojo people,

I have an app built for mac and windows that draws large bitmaps. (upto 32k x 32k). Mac version is fine however PC version throws a runtime error at anything over 8k pixels wide. The reported error is…

Common\Win32\DrawableD2D.cpp 441
Failure condition
SUCCEEDED(renderTarget ->CreateBitmapFromWicBitmap(bitmapWithMask, nullptr, &bitmap))

app available here if you want to see the problem…

https://pixlevolution.com/2017/11/22/pixl-grid/

Any help or suggestions to mitigate or fix gratefully received.

Not that this is very useful but it sounds familiar… <https://xojo.com/issue/46551>
In my case the bitmaps are not that big, and it takes some time and perhaps low memory situations to trigger it.

a 32k x 32k bitmap is around 3.2gig in size
I beleve (I may be mistaken) but for Windows the working memory space for an Applicatiion is only 2gig???

a 8k x 8k is 2.01gig

EDIT : seems its 4gig not 2, but it is 2gig Kernel, and 2gig Application (so I guess I was “right” :slight_smile: )

At a guess, as Xojo is using D2D now, it might be graphics card memory dependent. This could be tested by making a build in 64bit and see if it works or not. If it is the case I don’t think Xojo has given us a way to use software rendering to keep away from that limitation (not checked as I’ve not had the need to look).

Continuing these thoughts, a method with the name CreateBitmapFromWicBitmap may mean that there are two “copies” of the data in memory at the same time, doubling the required footprint. I’ll ask William to comment.

Xojo does some internal “caching”, which causes Pictures to use more memory…
See also <https://xojo.com/issue/54421>: Significantly increased memory consumption when putting images in array in Windows

Right, that is the unfortunate reality here, creating a 64-bit app may help. Before we get side tracked into the technical details though, please note that we carefully consider the consequences of our design. In this particular case speed trumps memory footprint.

Sure - but certainly makes sense in many situations.
However:

Having such a big Picture 2x (or even more - i don’t know the Framework’s internals) in Memory doesn’t make sense. For such a big Picture, memory trumps speed :slight_smile:
Maybe the Framework could only use it’s Buffer if the Picture is “not too big”…?

Hi,
Facing this one also on 2 customers computers, Xojo 2019r1.1, 64 bits build.

Any workaround or IDE correction ???

Thanks,
Fred

What image sizes are you working with?

Hi,

App is dealing with Pdf documents, maily A4 documents.
When the crash arrives, it’s after first installation. When opened, a page is displayed.

So the page is displayed in a canvas, and the image size is (1700, 2210 ) [width, height ]

Not very big, actually.

And another one today !!!

The customer’s machine is Windows 10, 64 bits, 4 Go Ram.

This is a very annoying problem !

Are you able to find out if they have similar hardware? i.e. integrated graphics cards with shared memory?

Also, have you tried a 32bit build or do you need 64bit?

How do you get from the pdf to the canvas? Have you written you own pdf class or do you use a 3rd party plugin?

Are they multi page pdf’s?

Are you able to open the same pdf without issue?

Are you able to log the “to be created” picture sure before you do so?

It’s the same when trying a 32 build.

And yes, I 'm using third party delarations, but it’s not a plugin. It’s a dll and I call declacre.

Mostly, there are multi page pdf which can be open without any trouble with an other Pdf reader.

It’ quite difficult to get a lot of information, as I’m dealing with one plue value added reseller, so I can not contact directly the customers…

One of them is a Dell Optilex, that’s what I know so far. And other Dell computer in the same site could update failrly…

Anyway, it’s working of hundred of PC, crahing on 3 for now. But we are updating more than a thousand customers…

And less than 10 % is done for now…
Very annoying problem !

My resseller, as well as me, are very upset bu this Xojo bug.

I can’t do anything to fix it ! No exception called, just a bad crash.

I hope Xojo team will be able to fix it quickly.

[quote=452148:@FrdricQUOIREZ]It’s the same when trying a 32 build.

And yes, I 'm using third party delarations, but it’s not a plugin. It’s a dll and I call declacre.

Mostly, there are multi page pdf which can be open without any trouble with an other Pdf reader.

It’ quite difficult to get a lot of information, as I’m dealing with one plue value added reseller, so I can not contact directly the customers…

One of them is a Dell Optilex, that’s what I know so far. And other Dell computer in the same site could update failrly…

Anyway, it’s working of hundred of PC, crahing on 3 for now. But we are updating more than a thousand customers…

And less than 10 % is done for now…
Very annoying problem !

My resseller, as well as me, are very upset bu this Xojo bug.

I can’t do anything to fix it ! No exception called, just a bad crash.

I hope Xojo team will be able to fix it quickly.[/quote]
Have you filed a bug report with a sample project and a crash report?

No - I don’t have a small project and I have never seen the crash in my own testing (Windows 10 64 bits, Windows 7 64 bits )

But, it looks like this one :
https://xojo.com/issue/46551

Here is an example of the crash :

Nice spam ^ ^

John Broad: 1 post, joined 2 hours ago.