View Issue Details

IDProjectCategoryView StatusLast Update
0009001mantisbtchange logpublic2008-08-11 09:42
Reportermurrayt5 Assigned Togiallu  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.1 
Fixed in Version1.2.0a2 
Summary0009001: memory exhausted on changelog
Description

Viewing change log page I see a number of lines of text correctly showing the changes in our applications but then I have the following at the end:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4864 bytes) in /var/data/mantis/core/string_api.php(309) : runtime-created function on line 1

Steps To Reproduce

I just click on the Change Log link and it occurs

TagsNo tags attached.

Activities

giallu

giallu

2008-03-26 12:01

reporter   ~0017461

Is that the only page where the problem occur?

In general, 8 MB is a little bit short as a memory limit, but the changelog should not be that memory intensive.

murrayt5

murrayt5

2008-03-27 09:05

reporter   ~0017476

It's the only page I've seen the error on so far.

It doesn't seem to happen when I'm viewing the page under the anonymous user account, only when I'm logged in under my account (haven't checked other user accounts) and only if I have All Projects selected.

herringm

herringm

2008-03-30 19:43

reporter   ~0017500

This happens w/ the Official Mantis Bugtracker change log:
http://www.mantisbt.org/bugs/changelog_page.php

vboctor

vboctor

2008-03-31 01:35

manager   ~0017503

This will be fixed once 0001910 is deployed as part of 1.2.x. We can probably optimize the memory usage of some of the pages, however, with the fix for 0001910, I think it is a lower priority.

plegall

plegall

2008-03-31 16:23

reporter   ~0017513

I also have a lot of issues (3500) and the change_log.php script cannot display them all, but I would really like to see change_log.php of past release. Something like a filter on N last releases or a multiple select would be useful.

giallu

giallu

2008-03-31 16:34

reporter   ~0017514

I downsized my php memory_limit from 32Mb (giving a working changelog) to 16Mb and can definitely confirm the issue.

Since I'm learning how to use xdebug I'll try to see if there is an obvious offender; no promises though...

giallu

giallu

2008-03-31 18:16

reporter   ~0017516

It seems that the main reason we are running out of memory (apart from loading the whole core/*_api.php set...) is that we cache all the bug's data while we compose the page.

Surely, reducing the scope of the changelog as proposed by plegall will help, but I'd prefer trying to improve the code so we don't break if someone has a large number of resolved issues in a single target version.

Victor, any idea?

vboctor

vboctor

2008-03-31 18:28

manager   ~0017517

Ideally our caches that are built into the core APIs should be limited to the last referenced N items (i.e. 50). Once we cache item 51, we should evict item 1 from the cache. Maybe its time to have some cache class that is re-used accross the different core APIs. This cache class should be useful with caching issues, issue notes, etc.

giallu

giallu

2008-03-31 18:48

reporter   ~0017518

Last edited: 2008-03-31 18:50

That's surely a good idea (another tick on the list of things to be revamped...)

in the meanwhile, I found out we can improve the situation (I can use again the changelog in 16MB) with the following:


diff --git a/core/custom_function_api.php b/core/custom_function_api.php
index e6b3784..9e26580 100644
--- a/core/custom_function_api.php
+++ b/core/custom_function_api.php
@@ -58,6 +58,7 @@
}

            echo ' - ', get_enum_element( 'status', $t_bug->status ), '.<br />';
  • bug_clear_cache( $p_issue_id );
    }

    # --------------------

giallu

giallu

2008-04-21 18:47

reporter   ~0017646

Fixed by applying the proposed patch.

The same was applied to roadmap

Related Changesets

MantisBT: master 189f54de

2008-04-21 18:45

giallu


Details Diff
Fix 9001: memory exhausted on changelog.

The bug data cache is dropped at each iteration so the
memory consumption is lowered

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5190 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0009001
mod - core/custom_function_api.php Diff File