Hello,
any clue regarding memory leak?
Thanks!
On Wed, Sep 17, 2008 at 3:43 PM, Jack D <[EMAIL PROTECTED]> wrote:
> Hi bluezehn,
> Here is the code:
>
> <input name="modelName" id="modelName" maxlength="100" size="100" value=""
> class="button" type="text" autocomplete="off">
> <span id="inprogress" style="display: none"><img
> src="images/inprogress.gif" alt="Working..." /></span>
> <div id="companyHint" class="autocomplete"></div>
> <script type="text/javascript">
> new Ajax.Autocompleter("modelName", "companyHint", "abc.php", {paramName:
> "modelName", minChars: 2, indicator: 'inprogress', callback: null,
> afterUpdateElement: getSelectedId});
> function getSelectedId(text, li) {
> $('company_id').value = li.id;
> $('company_name').value = text.value;
> }
> </script>
>
> abc.php
> =======
> <?php
> require_once("io.inc");
> $CBO = new db();
> $ModelDetails = '';
> $modelName = $_POST["modelName"];
> if (strlen(trim($modelName)) > 0) {
> $CompanyDetails = $CBO->GetCompanyNames($companyName);
> } else {
> header("Location: index.php");
> }
> echo $ModelDetails;
> ?>
>
> io.inc
> ======
> $resultList = "";
> $workList = array();
> $sql = "SELECT id, name, swing FROM model WHERE upper(name) like upper(?)
> ORDER BY name";
> $dbResult = $this->dbHandle->query($sql, array('%'.$modelName.'%'));
> if (DB::isError($dbResult)) {
> return false;
> } else {
> while ($workList = $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
> $resultList .= "<li id=\"". $workList["id"] . "\">";
> $resultList .= preg_replace("/($modelName)/i", "<strong>$1</strong>",
> $workList['name']);
> $resultList .= "<span class=\"informal\">";
> $resultList .= " (" . $workList["swing"] . ")";
> $resultList .= "</span>";
> $resultList .= "</li>";
> }
>
> if ($resultList == "") {
> $resultList = "<ul><li>No Match Found</li></ul>";
> } else {
> $resultList = "<ul>".$resultList."</ul>";
> }
> return $resultList;
> }
>
> Can you help me please?
>
> Thanks!!!
> On Wed, Sep 17, 2008 at 12:49 PM, bluezehn <[EMAIL PROTECTED]>wrote:
>
>>
>> I couldn't find the same issue. Are you sure it's not some of your
>> code or a callback you've written or something that's causing this?
>> Maybe post your code so someone can take a look at it.
>>
>> On Sep 17, 8:31 pm, "Jack D" <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> > Does any one has any update regarding the IE issue of memory leak for
>> > autocompleter? The IE size goes on increasing for autocompleter & never
>> > comes down....
>> >
>> > Thanks!
>> >
>> > On Mon, Sep 15, 2008 at 5:46 PM, Jack D <[EMAIL PROTECTED]> wrote:
>> > > Hi bluezehn,
>> > > Thanks for the reply!
>> >
>> > > Regarding Item 1, I'm using IE 6.0 on Windows XP Professional.
>> the
>> > > memory goes on increasing continoulsy as I go on using AJAX in
>> > > autocompleter. I also observed that the memory increases with all
>> browsers.
>> > > With Firefox, the speed with which it increases is relatively slow. If
>> IE is
>> > > taking 100 MB, then firefox will take around 60 MB....However, the
>> memory
>> > > increases & thts for sure....eventually browser starts responding
>> > > slowly.....
>> >
>> > > I'll appreciate if you can look into it.....
>> > > Thanks!
>> >
>> > > On Mon, Sep 15, 2008 at 4:06 PM, bluezehn <
>> [EMAIL PROTECTED]>wrote:
>> >
>> > >> Hi there,
>> > >> In response to question 1, what version of IE are you using? Let me
>> > >> know and I'll see if I can replicate this.
>> >
>> > >> 2: You always have to load all of prototype. You can as you point out
>> > >> just load specific parts of scriptaculous. In my opinion, it's not
>> > >> worth bothering with. The download size you save for the user is
>> > >> negligible - less than something like a 100x100 image I think. I'm
>> not
>> > >> sure which module of scriptaculous the autocompleter is in, but I'm
>> > >> sure you can find it in the API somewhere. Seriously don't worry
>> about
>> > >> it though - was working on a plone site at work today and had a look
>> > >> at the source code - plone had imported jquery for fun, then about 20
>> > >> other javascript files for various kss stuff and kupu functions and
>> > >> god knows what else.
>> > >> In short, it's never going to be the bottleneck of a site's
>> > >> performance.
>> >
>> > >> On Sep 15, 6:10 pm, "Jack D" <[EMAIL PROTECTED]> wrote:
>> > >> > Hi,
>> > >> > I'm using 1.8.1 AJAX autocompleter. So far so good.
>> >
>> > >> > Question 1:
>> > >> > I've set minchar to 1. When I type say "a" in search text box, it
>> > >> displays
>> > >> > hints. If I do it again & again on this page (delete "a" & then
>> again
>> > >> type
>> > >> > "a"), I can see some memory leak. When I kept my Windows Task
>> Manager
>> > >> open,
>> > >> > the Mem Usgae for IEXPLORE kept on increasing. It started from 25MB
>> &
>> > >> went
>> > >> > to 200MB. The more you keep typing "a" or searching different
>> words, the
>> > >> > memory goes on increasing. The CPU usage goes to 70% as well but it
>> > >> comes
>> > >> > down to 0% as soon as the hints are displayed. However, the memory
>> does
>> > >> not
>> > >> > go down at all. Is Scruptaculous leaking memory?? Once the memory
>> goes
>> > >> > beyond 200 MB for IEXPLORE, the browser responds real SLOW. Same is
>> the
>> > >> > bahaviour with Firefox.
>> >
>> > >> > Can any tell me if scriptaculous is leaking memory & how to fix
>> it??
>> >
>> > >> > Question 2:
>> > >> > I'm including follwoign 2 scripts in all pages wherever I need to
>> call
>> > >> the
>> > >> > autocompleter:
>> > >> > <script language="JavaScript" type="text/Javascript"
>> > >> > src="javascripts/scriptaculous/prototype.js"></script>
>> > >> > <script language="JavaScript" type="text/Javascript"
>> > >> > src="javascripts/scriptaculous/scriptaculous.js"></script>
>> >
>> > >> > I wanna know if including above scripts loads all the other
>> libraries
>> > >> as
>> > >> > well or how exactly does it work? I mean I want to make sure that
>> it
>> > >> shoould
>> > >> > only include automecomplete stuff which I needed.
>> >
>> > >> > I saw few ppl using following:
>> >
>> > >> > <script language="JavaScript" type="text/Javascript"
>> > >> >
>> src="javascripts/scriptaculous/scriptaculous.js?load=effects"></script>
>> >
>> > >> > Can any one tell me including specific loads will improve
>> performance?
>> > >> > Also, in case of autocompleter, what should I pass as a parameter
>> to
>> > >> load
>> > >> > for both scriptaculous.js & prototype.js?
>> >
>> > >> > Thanks!!
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---