Don't cache JRuby runtime in static fields

Aperta
#707 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@headius ci sta già lavorando.

Dal 21/11/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

jruby

There are a few places where we cache the JRuby runtime or runtime-specific objects in a static field, such as here with a WeakReference:

https://github.com/ruby/json/blob/7d2ad6d6556da03300a5aeadeeacaec563435773/java/src/json/ext/RuntimeInfo.java#L83-L91

The runtimes cached in weak references will not "leak" but it may take longer for the runtime to be collected than normal. In addition, the cost of traversing the weak reference may offset any gains from caching runtime objects.

These should be removed and cached in a runtime-safe way.

Lingua principale
Ruby
Stelle
787
Fork
392
Merge medio
6h 4m
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ruby/json

Tutte le issue di ruby/json

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.