Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Memory is never released
14/11/2012
18:47
Avatar
destells
New Member
Members
Forum Posts: 2
Member Since:
14/11/2012
sp_UserOfflineSmall Offline

I'm testing with a simple example that create a grid when the page is loaded.

The HTML code:

<button id="createGridBtn">Create grid</button>
<div id="grids">
</div>

The JS code:

var createGrid = function () {

          $grid = jQuery('<table id="grid"></table>');
          $grid.appendTo(jQuery('#grids'));

          $grid.jqGrid({
              data: [],
              datatype: 'local',
              width: 700,
              height: 'auto',
              colNames: [
                  'Id',
                  'Type',
                  'Description',
                  'Notes',
                  'Main'
              ],
              colModel: [
                  {
                      name: 'contactDataId',
                      index: 'contactDataId',
                      width: 0,
                      sorttype: "int",
                      hidden: true
                  },
                  {
                      name: 'typeName',
                      index: 'typeName',
                      width: 4
                  },
                  {
                      name: 'description',
                      index: 'description',
                      width: 5
                  },
                  {
                      name: 'notes',
                      index: 'notes',
                      width: 2
                  },
                  {
                      name: 'isMain',
                      index: 'isMain',
                      width: 2,
                      align: "center"
                  }
              ],
              multiselect: true,
              caption: 'Contact data'
          });

      };

      var _destroyAndCreateGridHandler = function (event) {
          jQuery('#grid').jqGrid('GridDestroy');
          createGrid();
      };

      $(document).ready(function() {

          createGrid();
          jQuery('#createGridBtn').on('click', _destroyAndCreateGridHandler);

      });

Then, when I click in the button, the old grid is destroyed and creates a new grid.

I have been analyzing this test with the "Take Head Snapshot Profile" of Google Chrome:

  • Loaded page: 3.20MB
  • Perform click on the button: 3.28MB
  • Another click: 3.35MB
  • ...

As I could see, the memory grows when I destroy the old grid and create the new.

My question is, why? The memory should be the same, because I'm destroying the old grid and create the new.

Please, can anyone help me?

12/12/2012
11:56
Avatar
Roman
New Member
Members
Forum Posts: 2
Member Since:
12/12/2012
sp_UserOfflineSmall Offline

Same problem here. Please, anyone?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information