Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-40

Memory management in BigDataBag is probably wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.1.0
    • impl
    • None

    Description

      src/org/apache/pig/data/BigDataBag.java

      1) You should not use finalizers for things other than external resources – using them here is very dangerous and could inadvertantly lead to deadlocks and object resurrection and just decreases performance without any advantage.
      2) Using .freeMemory() the way it is used in this class is broken. freeMemory() is going to return a mostly random number between 0 and the real amount. Adding gc() in here is a terrible performance burden. If you really want to do something like this you should using softreferences and finalization queues.

      Attachments

        1. MemoryUsage.java
          2 kB
          Sam Pullara
        2. BigDataBag.java
          13 kB
          Sam Pullara

        Issue Links

          Activity

            People

              breed Benjamin Reed
              spullara Sam Pullara
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: