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 6729117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:15:03+00:00 2026-05-26T10:15:03+00:00

Would such a language be feasible or are there specific features in go that

  • 0

Would such a language be feasible or are there specific features in go that absolutely require some form of a gc?

note: I am not anti-gc, but coming from a C/C++ background and working on a real-time server application, I prefer to maintain some level of control how and when memory is reaped (can’t have a 10s garbage-collection happening in the middle of a live run).

Are my concerns realistic, given my requirements? Or is the go gc so good that my concerns are unfounded?

Go’s gc is my only reservation about attempting a port of my C++ real-time server to go.

  • 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-05-26T10:15:03+00:00Added an answer on May 26, 2026 at 10:15 am

    Go with optional GC would require language changes. Here’s a perfectly valid Go function that will make a C programmer’s skin crawl:

    func foo() *int {
        a := 1
        return &a
    }
    

    This is fine because the Go compiler will figure out that the variable a needs to be allocated on the heap. It will be garbage collected later and you don’t have to care. (Well, ok, in some situations you might. But most of the time you don’t.)

    You can concoct all kinds of scenarios where the compiler will do things like this. It just wouldn’t be the same without a garbage collector.

    There are things you can do to help GC times, but to a certain extent you’ll be nullifying the advantages of the language. I hesitate to recommend these practices, but are options:

    • Free lists
    • With the unsafe package you can even write your own allocator and manually free memory, but you’d need a function for every type you want to allocate. Or use reflection to pass in the type you want to allocate, return an empty interface, and use type assertions to get concrete values out.

    The bottom line is, Go probably isn’t a good choice for applications with hard real-time requirements. That said, I also don’t think you’ll see anything approaching a 10 second garbage collection. Consider what your requirements really are and if you have any doubts, do some measurements.

    Try the latest Go code if you can. There are some garbage collector improvements and some compiler optimizations that cause fewer allocations. If your release time frame is shorter, though, you may be stuck with the current stable release for several months.

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

Sidebar

Related Questions

As I'm writing JavaScript I'm always missing some fairly basic language features that JavaScript
I would like to set up an XSD such that it enforces something like
What would be your preferred way to concatenate strings from a sequence such that
In the following example, is there a way to construct the object such that
I was just wondering how exactly memory works such that a language standard (such
I've been mulling over creating a language that would be extremely well suited to
How would a person use the Lua scripting language to do things such as
One of the only languages that compiles to a high level language such as
I cant see who would make such a decision but is there any such
CoffeeScript gets converted to JavaScript, Groovy to Java. Is there a language that was

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.