Memory leak in JfrUpcalls::on_retransform

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 20
    • Affects Version/s: 19, 20
    • Component/s: hotspot
    • None
    • jfr
    • b27

      LSan identified another memory leak. JfrUpcalls::on_retransform uses os::malloc to allocate bytes for ClassFileStream. However ClassFileStream does not take ownership of the bytes. Based on JfrUpcalls::new_bytes_eager_instrumentation it should have used NEW_RESOURCE_ARRAY_IN_THREAD_RETURN_NULL. However for some reason JfrUpcalls::on_retransform creates another ResourceMark, even though the caller already created one. I believe the correct approach should be to remove the ResourceMark in JfrUpcalls::on_retransform and use NEW_RESOURCE_ARRAY_IN_THREAD_RETURN_NULL.

            Assignee:
            Justin King
            Reporter:
            Justin King
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: