# Instance (computer science)

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Instance_(computer_science)
> Markdown URL: https://mediated.wiki/source/Instance_(computer_science).md
> Source: https://en.wikipedia.org/wiki/Instance_(computer_science)
> Source revision: 1344277016
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{short description|Concrete manifestation of an element (type) in computer science}}
{{Other uses|Instance (disambiguation)#Computing{{!}}Instance (disambiguation)}}

In computer science, an '''instance''' or [token](/source/Type%E2%80%93token_distinction) (from [metalogic](/source/metalogic) and [metamathematics](/source/metamathematics)) is a specific occurrence of a software element that is based on a [type](/source/data_type) definition.<ref name="CommonBase">{{cite report
|last1=Dahl
|first1=Ole-Johan
|author-link=Ole-Johan Dahl
|last2=Myhrhaug
|first2=Bjørn
|last3=Nygaard
|first3=Kristen
|author3-link=Kristen Nygaard
|date=1970
|url=http://www.edelweb.fr/Simula/#7
|title=Common Base Language
|publisher=Norwegian Computing Center
|access-date=20 August 2025
|url-status=usurped
|archive-url=https://web.archive.org/web/20240919044713/https://www.softwarepreservation.org/projects/ALGOL/manual/Simula-CommonBaseLanguage.pdf
|archive-date=2024-09-19
}}</ref>{{rp|1.3.2}}
When created, an occurrence is said to have been ''instantiated'', and both the creation process and the result of creation are called ''instantiation''.

== Examples ==

; '''Chat AI instance''': In chat-based AI systems, an assistant can be invoked across many independent conversation sessions (often called a ''thread''), each with its own message history. A specific execution of the assistant over that session may be represented as a ''run'' (an execution on a thread).<ref>{{cite web |title=Runs (OpenAI API Reference) |publisher=OpenAI |url=https://platform.openai.com/docs/api-reference/runs |access-date=10 February 2026}}</ref><ref>{{cite web |title=Azure OpenAI Assistants API (Preview) |publisher=Microsoft Learn |url=https://learn.microsoft.com/en-us/azure/ai-foundry/openai/concepts/assistants?view=foundry-classic |access-date=10 February 2026}}</ref>

; '''Class instance''': In object-oriented programming, an [object](/source/Object_(computer_science)) created from a [class](/source/Class_(programming)) type. Each instance of a class shares the class-defined structure and behavior but has its own identity and state.<ref>{{cite web |title=Chapter 4. Types, Values, and Variables (Java Language Specification) |publisher=Oracle |url=https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html |access-date=10 February 2026}}</ref><ref>{{cite web |title=Classes and Objects (ISO C++ FAQ) |publisher=isocpp.org |url=https://isocpp.org/wiki/faq/classes-and-objects |access-date=10 February 2026}}</ref>

; '''Procedural instance''': In some contexts (including Simula), each procedure call can be viewed as an instance of that procedure—an activation with its own parameters and local variables.<ref name="CommonBase"/>{{rp|1.3.2}}

; '''Computer instance''': In cloud computing and virtualization, an ''instance'' commonly refers to a provisioned virtual machine or virtual server with an allocated combination of compute, memory, network, and storage resources.<ref>{{cite web |title=What is Amazon EC2? (Concepts) |publisher=Amazon Web Services Documentation |url=https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html |access-date=10 February 2026}}</ref><ref>{{cite web |title=What is a virtual machine (VM)? |publisher=Red Hat |url=https://www.redhat.com/en/topics/virtualization/what-is-a-virtual-machine |access-date=10 February 2026}}</ref>

; '''Polygonal model''': In [computer graphics](/source/computer_graphics), a model may be instanced so it can be drawn multiple times with different transforms and parameters, improving performance by reusing shared geometry data.<ref>{{cite web |title=Efficiently Drawing Multiple Instances of Geometry (Direct3D 9) |publisher=Microsoft Learn |url=https://learn.microsoft.com/en-us/windows/win32/direct3d9/efficiently-drawing-multiple-instances-of-geometry |access-date=10 February 2026}}</ref>

; '''Program instance''': In a [POSIX](/source/POSIX)-oriented operating system, a running [process](/source/process_(computing)) is an instance of a program. It can be instantiated via [system call](/source/system_call)s such as [fork()](/source/fork_(system_call)) and [exec()](/source/exec_(system_call)). Each executing process is an instance of a program it has been instantiated from.<ref>{{cite book |last=Bach |first=Maurice J. |title=The Design of the UNIX Operating System |publisher=Prentice Hall |year=1986 |isbn=0-13-201799-7 |archive-url=https://archive.org/details/designofunixoper00bach |archive-date=2010-03-15 |url={{Google books|id=NrBQAAAAMAAJ |plainurl=yes}} |pages=10, 24 }}</ref>

== References ==
{{Reflist}}

Category:Object (computer science)
Category:Artificial intelligence

---
Adapted from the Wikipedia article [Instance (computer science)](https://en.wikipedia.org/wiki/Instance_(computer_science)) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Instance_(computer_science)?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
