Code Monkey home page Code Monkey logo

gd-icon-renderer's Introduction

gd-icon-renderer's People

Contributors

oatmealine avatar

Watchers

 avatar  avatar

gd-icon-renderer's Issues

Memory leak

Uh oh!!:

require "../src/gd-icon-renderer.cr"

ITERS = 1_000

puts "running #{ITERS} iterations"

GAME_SHEET_02 = IconRenderer::Assets.load_spritesheet("data/GJ_GameSheet02-uhd.plist")
GAME_SHEET_GLOW = IconRenderer::Assets.load_spritesheet("data/GJ_GameSheetGlow-uhd.plist")
ANIMATIONS = IconRenderer::Assets.load_animations("data/Spider_AnimDesc.plist")

(1 .. ITERS).each do |i|
  icon_img = IconRenderer::Renderer.render_spicy("spider_01", [0.0, 0.0, 0.0, 1.0], [255/255, 125/255, 125/255, 1.0], true, GAME_SHEET_02, GAME_SHEET_GLOW, ANIMATIONS)
  icon_img.write_to_file("icon_rendered.png")
end

This will initially run fast as expected, but around iteration ~50 it'll slow down, and keep slowing down, and keep slowing down, and, in the meanwhile, keep using RAM, and keep using RAMโ€ฆ. The production instance has crashed because of this and I'd like to avoid this, but I've tried to debug this for a full hour and I can't find any way to mitigate it even slightly.

This seems to be a bug in the CrystalVips package, which is not too unexpected, because it's a bit.. how do I put this, untested? I managed to find a basic typo by complete accident (PR'd in naqvis/crystal-vips#2, but still) and another typo while debugging this, it might be worth it to switch over to using command-line vips (or ImageMagick if that fails..???)

I have never dealt with low-level issues like this because I've rarely touched low-level programming, and from my little attempts at getting valgrind to cooperate with finding the culprit of this issue I've realized I don't think I can solve this on my own, so help is greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.