question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Much higher RAM usage on x64 compared with x86

See original GitHub issue

Description

We are putting images to GPU(texture based SKImage) to render them later with perfect performance. On x86 build images are allocating only GPU RAM. On x64 build images are allocating also CPU RAM.

This is a huge issue for us 👎. App is working some times slower on x64 and eating a lot more RAM, like 10 times more in some cases(200mb vs 2gb), because we store a lot images on GPU.

I’ve provided a repro project repo link below.

Code

using (var surf = SKSurface.Create(_grContext, false, _imageInfo, 1, GRSurfaceOrigin.TopLeft))
{
    surf.Canvas.DrawImage(_rasterImg, 0, 0);
    surf.Canvas.Flush();
    _textureImages.Add(surf.Snapshot());
}

Is there a better way to transform raster image to texture-backed image? We’ve tried to create textures and then push image to it - but this approach generated some artifacts on rendering.

Expected Behavior

On x86 Snapshot() SKImage is allocating only GPU memory On x64 Snapshot() SKImage is allocating only GPU memory

Actual Behavior

On x64 Snapshot() SKImage is allocating only GPU memory On x64 Snapshot() SKImage is allocating GPU and CPU memory

Basic Information

  • Version with issue: 1.68
  • IDE: Visual Studio
    • Windows Classic: Windows 10
  • Target Devices: High-end PC

Reproduction Link

https://github.com/Mikolaytis/SkiaSharpMemoryIssue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Donsezancommented, Jun 19, 2019

This is a big problem! Please help!

1reaction
marizombiecommented, Jun 19, 2019

+1. Our team would highly appreciate your attention to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory usage targeting x86 vs x64
Hi ! I have a strange issue with memory when I switch from x86 taget to x64. Most of time the x86 build...
Read more >
x64 vs x86 Performance Considerations .Net
NET runtime seems to, at least in the current versions, perform more optimizations than the x86 equivalent. Things like inlining and memory ...
Read more >
What is the effect of running a 32 bit program on a 64 bit ...
Running a 32-bit program on a 64-bit operating system generally does not cause a higher consumption of RAM or CPU memory. Continue reading....
Read more >
32 vs 64 bit on low spec device
I think as a rule, 32bit may be ever so slightly faster (maybe not noticeably) than 64bit. But 64bit has major benefits, like...
Read more >
Should I play on x64 or x86? - Old School Gamers
Overall, x64 is much more capable than x86, utilizing all installed RAM, providing more hard drive space, faster bus speeds, and overall better...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found