Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297911

Memory leak in JfrUpcalls::on_retransform

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 20
    • 19, 20
    • 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.

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

              Created:
              Updated:
              Resolved: