Clear DOM objects and free up memory
491302
function () {
            var series = this,
              chart = series.chart,
              issue134 = /AppleWebKit\/533/.test(userAgent),
              destroy,
              i,
              data = series.data || [],
              point,
              prop,
              axis;

            // add event hook
            fireEvent(series, 'destroy');

            // remove all events
            removeEvent(series);

            // erase from axes
            each(series.axisTypes || [], function (AXIS) {
                axis = series[AXIS];
                if (axis) {
                    erase(axis.series, series);
                    axis.isDirty = axis.forceRedraw = true;
                }
            });

            // remove legend items
            if (series.legendItem) {
                series.chart.legend.destroyItem(series);
            }

            // destroy all points with their elements
            i = data.length;
            while (i--) {
                point = data[i];
                if (point && point.destroy) {
                    point.destroy();
                }
            }
            series.points = null;

            // Clear the animation timeout if we are destroying the series during initial animation
            clearTimeout(series.animationTimeout);

            // destroy all SVGElements associated to the series
            each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',
                'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {
                if (series[prop]) {

                    // issue 134 workaround
                    destroy = issue134 && prop === 'group' ?
                      'hide' :
                      'destroy';

                    series[prop][destroy]();
                }
            });

            // remove from hoverSeries
            if (chart.hoverSeries === series) {
                chart.hoverSeries = null;
            }
            erase(chart.series, series);

            // clear all members
            for (prop in series) {
                delete series[prop];
            }
        }
540556
function clearObject(object) {
  var key;

  for (key in object) {
    if (object.hasOwnProperty(key)) {
      // Ensures only writable properties are deleted.
      try {
        delete object[key];
      } catch (e) { }
    }
  }
}
1305758
public void cleanup() {
    htDictionary.clear();
    memoryEstimate.decrementTotalMemory(byteArray.getSizeInBytes());
    memoryEstimate.decrementTotalMemory(getSizeOfIntArrays());
    memoryEstimate.decrementDictionaryMemory(byteArray.size());
  }
687374
function() {
        if (this.__rendered) {
            this.purgeListeners();

            // Clear out innerHTML references
            this.yearEl = null;
            this.monthEl = null;
            this.errorEl = null;
            this.submitEl = null;
            this.cancelEl = null;
            this.firstCtrl = null;
            this.lastCtrl = null;
            if (this.navEl) {
                this.navEl.innerHTML = "";
            }

            var p = this.navEl.parentNode;
            if (p) {
                p.removeChild(this.navEl);
            }
            this.navEl = null;

            var pm = this.maskEl.parentNode;
            if (pm) {
                pm.removeChild(this.maskEl);
            }
            this.maskEl = null;
            this.__rendered = false;
        }
    }
881057
@Override
   public void clear()
   {
      for (int i = 0; i < size; i++) {
         elementData[i] = null;
      }

      size = 0;
   }
1203850
function() {
    var elMsgTbody = this._elMsgTbody;
    if(elMsgTbody) {
        var elTable = elMsgTbody.parentNode;
        Ev.purgeElement(elMsgTbody, true);
        elTable.removeChild(elMsgTbody);
        this._elTbody = null;
    }
}
806541
function()
	{
		// Cleans all objects where listeners have been added
		for (var i = 0; i < mxEvent.objects.length; i++)
		{
			if (mxEvent.objects[i].mxListenerList != null)
			{
				mxEvent.removeAllListeners(mxEvent.objects[i]);
			}
		}
	}
888078
function cleanDom(dom) {
  var result = [];
  for(var i=0;i<dom.length;i++) {
    var node = dom[i];
    //console.log(node);
    if(node.type=='directive') continue;
    if(node.type=='tag') {
      var k = node.name;
      var v = node.attribs || {};
      var obj = {};
      obj[k] = v;
      if(node.hasOwnProperty("children")) {
        //console.log(node.children);
        //console.log(cleanDom(node.children));
        _.each(cleanDom(node.children), function(o) { 
          if(!_.isObject(o) || !_.isObject(v)) {
            if(_.isObject(v)) {
              if(_.size(v)==0) {
                v=o;
              } else {
                v['_text']=o;
              }
            }  else if(_.isArray(v)) {
              v.push(o); 
            } else {
              v=[v];
              v.push(o);
            }
            obj[k] = v;
          } else {
            // first step is to merge same key items
            // basically convert them to arrays
            var sameKeys = _.intersection(_.keys(o), _.keys(v));
            _.each(sameKeys, function(k) {
              if(!_.isArray(v[k])) {
                v[k]=[v[k]];
              }
              v[k]=v[k].concat(o[k]);
            });
            var remainingObj = _.omit(o, sameKeys);
            _.extend(v, remainingObj); 
          }
        });
      }
      result.push(obj);
    }
    if(node.type=='text') {
      result.push(node.data);
    }
  }
  //console.log(result);
  return result;
}
1029383
function () {
            var prop;

            removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);
            if (!chartCount) {
                removeEvent(doc, 'mouseup', this.onDocumentMouseUp);
                removeEvent(doc, 'touchend', this.onDocumentTouchEnd);
            }

            // memory and CPU leak
            clearInterval(this.tooltipTimeout);

            for (prop in this) {
                this[prop] = null;
            }
        }
1336338
public void clear() {
        Node<K,V>[] tab;
        modCount++;
        if ((tab = table) != null && size > 0) {
            size = 0;
            for (int i = 0; i < tab.length; ++i)
                tab[i] = null;
        }
    }
1193444
def clear(*objects_to_clear):
    
    if not hasattr(_thread_local_data, 'current_space'):
        return

    space = current_space()
    for obj in objects_to_clear:
        space.clear(obj)
75924
function cleanUp() {
    publicAPI.removeRenderObserver(model.view_id);
    publicAPI.unsubscribeRenderTopic();
    while (model.urlToRevoke.length) {
      window.URL.revokeObjectURL(model.urlToRevoke.pop());
    }
  }
645296
function()
	{
		var boundView, i, l;

		// Destroy boundviews
		if(this.boundViews !== null)
		{
			for(i = 0, l = this.boundViews.length; i < l; i++)
			{
				boundView = this.boundViews[i];
				boundView.destroyAll();
				if(boundView.element && boundView.element.parentNode) boundView.element.parentNode.removeChild(boundView.element);
			}
			this.boundViews = null;
		}

		if(this.anchor)
		{
			if(this.anchor.parentNode)
			{
				this.anchor.parentNode.insertBefore(this.view.element, this.anchor.nextSibling);
				this.anchor.parentNode.removeChild(this.anchor);
			}
			this.anchor = null;
		}
		if(this.elementTemplate)
		{
			if(this.elementTemplate.parentNode)
			{
				this.elementTemplate.parentNode.removeChild(this.elementTemplate);
			}
			this.elementTemplate = null;
		}
		this.viewTemplate = null;
		if(this.collection) this.collection = null;
	}
854409
function() {
      var el = this.getEl();
      
      // Unsubscribe all listeners on the updatedEvt
      this.updatedEvt.unsubscribeAll();
      
      // Purge element (remove listeners on el and childNodes recursively)
      util.Event.purgeElement(el, true);
      
      // Remove from DOM
      if(Dom.inDocument(el)) {
         el.parentNode.removeChild(el);
      }
      
   }
1121665
function () {
            if (this.__stackCache) {
                for (var key in this.__stackCache) {
                    if (this.__stackCache.hasOwnProperty(key)) {
                        var stack = this.__stackCache[key];
                        // break dom reference
                        for (var i = 0, l = stack.length; i < l; i++) {
                            stack.target = null;
                            stack.expandoValue = null;
                            delete stack.target;
                            delete stack.expandoValue;
                        }
                        delete this.__stackCache[i];
                    }
                }
                this.__stackCache = null;
            }
        }
1313380
protected void clear() {

        for (I_CmsDropTarget target : m_targets) {
            target.removePlaceholder();
        }
        if (m_dragHelper != null) {
            m_dragHelper.removeFromParent();
            m_dragHelper = null;
        }
        m_placeholder = null;
        m_currentTarget = null;
        m_draggable = null;
        Document.get().getBody().removeClassName(
            org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.dragdropCss().dragStarted());
        m_currentAnimation = null;
        m_modifierCTRL = false;
    }
374346
function() {
      this.trigger('before-dispose');
      this.trigger('before-dispose-callback');
      this._dispose();

      // Detach DOM and deactivate the view
      this.detach();
      this.deactivate();

      // Clean up child views first
      this.__disposeChildViews();

      // Remove view from DOM
      if (this.$el) {
        this.remove();
      }

      // Unbind all local event bindings
      this.off();
      this.stopListening();
      if (this.viewState) {
        this.viewState.off();
        this.viewState.stopListening();
      }
      if (this.feedbackCell) {
        this.feedbackCell.off();
        this.feedbackCell.stopListening();
      }
      // Delete the dom references
      delete this.$el;
      delete this.el;

      this.__isDisposed = true;
      this.trigger('after-dispose');
    }