Coder Social home page Coder Social logo

Comments (5)

casperisfine avatar casperisfine commented on June 2, 2024

Hello. I've seen similar issues in the past, particular in apps using Sidekiq on Ruby 3.0 because of a Ruby bug.

I assume one of the line may be corrupted.

You can get rid of these broken lines with heap-profiler clean path/to/file.json. See f7da0ad

But I'd also love if you could share the broken lines, so I could see if it's another Ruby bug I could fix. You can use the same File.readlines { JSON.parse } snippet to identify them.

from heap-profiler.

casperisfine avatar casperisfine commented on June 2, 2024

Hum, actually, re-reading the error, the issue isn't strictly a JSON syntax error, but that one of the values isn't of the expected type.

To identify it you may need to bisect the heap.

from heap-profiler.

casperisfine avatar casperisfine commented on June 2, 2024

Also was the heap dump generated with 3.2.1? Or is that just your local ruby?

from heap-profiler.

theSoenke avatar theSoenke commented on June 2, 2024

@casperisfine thanks a lot. heap-profiler clean fixed the problem! I've been using Ruby 3.2.1 both where the heap was created and locally. In general it also seems to be a valid JSON file and parsing it line by line seemed to work.

Here's also a diff before and after the clean step:

1494103d1494102
< 80, "flags":{"wb_protected":true, "old":true, "uncollectible":true, "marked":true}}
1494123d1494121
< {"address":"0x7f9d07934990", "type":"STRING", "shape_id":12, "slot_size":80, "class":"0x7f9d093aed98", "frozen":true, "embedded":true, "fstring":true, "bytesize":23, "value":"indeterminate_check_box", "encoding":"UTF-8"

from heap-profiler.

casperisfine avatar casperisfine commented on June 2, 2024

Hum, the first like is clearly only the half-end of a JSON object, I wonder what happened here.

The second line seem fine except that it's not terminated. I wonder if it might be a flushing issue of some sort.

from heap-profiler.

Related Issues (3)

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.