Problem with Codespace storage usage and free limits #207609
Replies: 4 comments
|
I meant that I would have had to have had 20 GB of Codespace storage (more than 10 Codespaces) in continuous existence for the entire month so far if my usage is really 6.68 GB-month. -Jim McCormick |
|
The mismatch in your calculations stems from how GitHub Codespaces provisions and meters disk storage versus compute: 1. Default Provisioned Disk Size (32 GB) vs. Actual File SizeEven if a student's repository or code takes up only 100 MB or 2 GB, GitHub Codespaces provisions a 32 GB block storage disk for standard virtual machines by default. Storage usage is calculated based on the allocated disk capacity, not the amount of space currently occupied by files inside the container. 2. Stopped Codespaces Still Consume StorageWhen students finish a lab and close their browser tab, the Codespace enters a stopped state. Compute billing halts immediately once the idle timeout expires, but the provisioned 32 GB disk continues to exist and accrue storage until the codespace is explicitly deleted. 3. How the 15 GB-Month Math Works OutGitHub calculates storage continuously:
Because the default retention period for stopped codespaces is 30 days, a student who created 2 or 3 codespaces during early September labs and left them stopped without manually deleting them exhausted their entire 15 GB-month free monthly quota in about a week. 4. How to Resolve and Prevent This
|
|
Yes, I have seen these calculations, but they are definitively incorrect.
I have had multiple code spaces in existence for the entirety of September
and my codespace storage usage is currently listed as 6 GB-hr (whatever
that means). All of my students have had multiple code spaces in existence
for most of September as well, and only one has run of space.
This is my third year using GitHub codespaces in my classes. All of my
students have had multiple codespaces in existence the entire year without
running out of space. It definitely seems something had changed, but it
can't be as bad as your calculations suggest or we would have all run out
of storage in the first week of September.
Jim McCormick
Jim McCormick
Computer Science Instructor
Liberty Common High School
***@***.***
www.libertycommon.org
2745 Minnesota Dr, Fort Collins, CO 80525
…On Sat, Sep 12, 2026, 12:30 AM Ama Senevirathne ***@***.***> wrote:
The mismatch in your calculations stems from how GitHub Codespaces
provisions and meters disk storage versus compute:
1. Default Provisioned Disk Size (32 GB) vs. Actual File Size
Even if a student's repository or code takes up only 100 MB or 2 GB,
GitHub Codespaces provisions a *32 GB block storage disk* for standard
virtual machines by default.
Storage usage is calculated based on the *allocated disk capacity*, not
the amount of space currently occupied by files inside the container.
2. Stopped Codespaces Still Consume Storage
When students finish a lab and close their browser tab, the Codespace
enters a *stopped* state. Compute billing halts immediately once the idle
timeout expires, but the provisioned 32 GB disk continues to exist and
accrue storage until the codespace is explicitly deleted.
3. How the 15 GB-Month Math Works Out
GitHub calculates storage continuously: 1 GB-month is equivalent to 1 GB
maintained for the full month (~720 hours).
- *1 Codespace (32 GB)* existing for *11.25 days* (270 hours):
32 GB * 270 hours / 720 hours = 12 GB-months
- *2 Codespaces (64 GB total)* existing across two consecutive labs
for just *7 days* (168 hours):
64 GB * 168 hours / 720 hours = 14.93 GB-months
Because the default retention period for stopped codespaces is *30 days*,
a student who created 2 or 3 codespaces during early September labs and
left them stopped without manually deleting them exhausted their entire 15
GB-month free monthly quota in about a week.
4. How to Resolve and Prevent This
1. *Delete Existing Stopped Codespaces*:
Have students visit github.com/codespaces, review their list of
existing codespaces, and click the three dots (...) -> *Delete* on
codespaces from completed labs.
2. *Shorten the Default Retention Period*:
- Students can reduce their retention period in *Settings* >
*Codespaces* > *Retention period* (e.g. set to 1 day or 3 days).
- If codespaces are organization-managed, an organization owner can
enforce a retention policy under *Organization Settings* >
*Codespaces* > *Policies* > *Retention period*.
3. *Check for Prebuilds*:
Ensure Codespace prebuilds are not enabled on the template
repositories unless specifically needed, as stored prebuild images also
consume storage quota.
4. *Inspect the Detailed Usage Report*:
To see the exact codespace IDs, provisioned gigabytes, and hourly
timestamps that contributed to the student's or your quota, go to
*Settings* > *Billing and plans* > *Get usage report*, select
Codespaces, and download the CSV report.
—
Reply to this email directly, view it on GitHub
<#207609?email_source=notifications&email_token=BEAU6SPR3HTC44FD344SOWT5OTUQRA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUGA4TOMRQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVRTG633UMVZF6Y3MNFRWW#discussioncomment-18409720>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEAU6SK4XHZCT6LYJKUGOVD5OTUQRAVCNFSNUABIKJSXA33TNF2G64TZHMZTAMJVG4ZTGNBUHNCGS43DOVZXG2LPNY5TCMBXHE4DEOJTUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BEAU6SOUR7SUXBX34TQWC7L5OTUQRA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUGA4TOMRQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVJTG633UMVZF62LPOM>
and Android
<https://github.com/notifications/mobile/android/BEAU6SNWZBZ2LMS67BQZ6K35OTUQRA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBUGA4TOMRQUZZGKYLTN5XKMYLVORUG64VFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Understanding Codespaces Storage BillingHi @mr-mccormick, Great question! There's some confusion about how GitHub calculates Codespaces storage. Let me clarify: Storage Billing Explained15 GB-month doesn't mean "15 GB for one month." It's calculated as:
So when GitHub shows 15 GB-hr, it's likely a display issue, but the calculation works similarly:
Why This HappensCommon reasons students hit storage limits quickly:
Quick FixesFor Students:
For You (as Teacher):
About Organization MembershipWhen students join your organization:
RecommendationImmediate Action:
Long-term:
This should resolve the issue! Most likely, students have multiple old Codespaces accumulating storage. Let me know if you need help with any specific step! |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
I am a Computer Science teacher. I had been using GitHub Classroom for my students until it was discontinued. I am now using the Classroom50 open source version of this functionality.
I have a student whom GitHub claims has run out of free resources.
GitHub lists his compute usage this month as 4.68 hr and his storage usage as 15 GB-hr.
GitHub says that free accounts get 120 core hours and 15GB-month. Notice that his usage is reported as 15 GB-hr which sounds like it would mean 15GB for a single hour or 1 GB for 15 hours. That would be an incredibly small amount. Given that GitHub says the student has used up all of his free resources, it might seem like their reporting of his usage as 15 GB-hr just has a typo in the units and they meant 15 GB-month. However, it would be nearly impossible for the student to have used this much storage. We are using codespaces that use less than 2GB of storage. We are 1/3 of the way through the month of September. For the student to have used 15 GB-month of storage already, he would have had to have 45 GB of storage (more than 22 Codespaces) in continuous existence for the entire month. We have only had a few labs so far, so I don't know how this could have been the case.
Furthermore, my usage is reported as 2.05 core hours and 6.68 GB-hr. If that really means 6.68 GB-month, then I would have had to 20 codespaces in existence continuously for the entire month. I have never had more than a few codespaces in existence at once. I understand the difference between running and existing. I know how to show a list of all Codespaces in existence. I never have more than a few in existence. Therefore, I couldn't possibly have use 6.68 GB-month of storage.
Now, Classroom50 was automatically running some actions (which I have now turned off). The only explanations that I can think of for the data is that either Classroom50 was somehow using a ton of resources listed as codespace storage or GitHub is not actually providing 15 GB-month of codespace storage.
It should also be noted that I had to invite my students to join our high schools GitHub organization for Classroom50 to work. Also, I have the Codespaces configured to be owned by and use the resources of the individuals who create them, not the organization. So, I guess another possibility is that GitHub is somehow giving less free resources to these individuals after they have joined my GitHub organization? (It should also be noted that none of these students have applied for official education accounts because those require two-factor authentication which would be difficult in our school lab environment.)
I'm stuck and very concerned that other students are going to soon be running out of free resources. Any potential insights would be appreciated.
-Jim McCormick
All reactions