Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:37:21+00:00 2026-06-02T07:37:21+00:00

Basically, now that APC is installed, I had assumed that memory tracing would show

  • 0

Basically, now that APC is installed, I had assumed that memory tracing would show less of it being taken when doing requires (since it’s shared). However, when doing traces using XDebug of the same page (before and after, with multiple reloads), it shows that the memory usage is still the same as it was before hand.

I have confirmed that APC is working by successfully outputting apc_cache_info().

Here is my APC config in PHP.ini

[APC]
; This can be set to 0 to disable APC.
apc.enabled=1
; The number of shared memory segments to allocate for the compiler cache.
apc.shm_segments=1
; The size of each shared memory segment, with M/G suffixe
apc.shm_size=64M
; A "hint" about the number of distinct source files that will be included or
; requested on your web server. Set to zero or omit if you're not sure;
apc.num_files_hint=1024
; Just like num_files_hint, a "hint" about the number of distinct user cache
; variables to store.  Set to zero or omit if you're not sure;
apc.user_entries_hint=4096
; The number of seconds a cache entry is allowed to idle in a slot in case this
; cache entry slot is needed by another entry.
apc.ttl=7200
; use the SAPI request start time for TTL
apc.use_request_time=1
; The number of seconds a user cache entry is allowed to idle in a slot in case
; this cache entry slot is needed by another entry.
apc.user_ttl=7200
; The number of seconds that a cache entry may remain on the garbage-collection list.
apc.gc_ttl=3600
; On by default, but can be set to off and used in conjunction with positive
; apc.filters so that files are only cached if matched by a positive filter.
apc.cache_by_default=1
; A comma-separated list of POSIX extended regular expressions.
apc.filters
; The mktemp-style file_mask to pass to the mmap module
apc.mmap_file_mask=c:/apc_cache/apc.XXXXXX
; This file_update_protection setting puts a delay on caching brand new files.
apc.file_update_protection=2
; Setting this enables APC for the CLI version of PHP (Mostly for testing and debugging).
apc.enable_cli=0
; Prevents large files from being cached
apc.max_file_size=1M
; Whether to stat the main script file and the fullpath includes.
apc.stat=1
; Vertification with ctime will avoid problems caused by programs such as svn or rsync by making
; sure inodes havn't changed since the last stat. APC will normally only check mtime.
apc.stat_ctime=0
; Whether to canonicalize paths in stat=0 mode or fall back to stat behaviour
apc.canonicalize=0
; With write_lock enabled, only one process at a time will try to compile an
; uncached script while the other processes will run uncached
apc.write_lock=1
; Logs any scripts that were automatically excluded from being cached due to early/late binding issues.
apc.report_autofilter=0
;This setting is deprecated, and replaced with apc.write_lock, so let's set it to zero.
apc.slam_defense=0

Edit #1

I finally got around to double check…

apc_cache_info() will show:

DEBUG: Array
(
    [num_slots] => 2048
    [ttl] => 7200
    [num_hits] => 4313
    [num_misses] => 124
    [start_time] => 1334152023
    [expunges] => 0
    [mem_size] => 21653480
    [num_entries] => 119
    [num_inserts] => 124
    [file_upload_progress] => 1
    [memory_type] => IPC shared
    [locking_type] => file
    [cache_list] => Array
        (
            [0] => Array
                (
                    [filename] => ...

phpinfo() will show:

apc

APC Support enabled
Version 3.0.15-dev
MMAP Support    Disabled
Locking type    File Locks
Revision    $Revision: 3.145 $
Build Date  May 31 2007 09:39:25

Can headers be sent that would change the behavior of APC? (ie. to always get a fresh copy of the web page?)

Edit #2

I even increased the apc.max_file_size setting to 5M, just to see if that was the issue. Same thing. Requires are still using the same amount of RAM between reloads.

I also noticed that [num_hits] for files does increase.

Edit #3

From my trace file:

0.0740    6152208  +492816     -> require(E:\my_require.php) E:\main.php:60

Shouldn’t the memory delta show a considerably lower value on subequent passes, once it has been cached?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:37:23+00:00Added an answer on June 2, 2026 at 7:37 am

    Edit #3

    From my trace file:

    0.0740 6152208 +492816 -> require(E:\my_require.php) E:\main.php:60

    Shouldn’t the memory delta show a considerably lower value on
    subequent passes, once it has been cached?

    yes it should
    also i thought that using a cache engine would make it so that it would cache and share the memory limiting the amount of memory used for the scripts

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, we have an ASP website right now that I'm converting to PHP. We're
Basically I am java developer and exploring ruby and ruby related framework right now.
So basically, I have a div which is runat=server <div id=results runat=server class=results></div> Now,
I've been at this for a bit now. Basically, I'm needing to add a
I've created an Engine which is basically used for all of our projects. Now
I've been working on this for a couple of days now without success. Basically,
Been trying to get this up and running for a while now. Basically i
Basically I have some variables that I don't want to preinitialize: originalTime = None
basically i have (state, state code) pairs, that are subsets of country [USA] ->
Just a technology update, now that .NET 4.0 is out. I write an application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.