Questions tagged [runtime]

Runtime is the time during which a program is running (executing)

In computer science, run time, run-time, runtime, or execution time is the time during which a program is running (executing), in contrast to other phases of a program's lifecycle such as compile time, link time, load time, etc.

A run-time error is detected after or during the execution of a program, whereas a compile-time error is detected by the compiler before the program is ever executed. Type checking, storage allocation, code generation, and code optimization are typically done at compile time, but may be done at run time depending on the particular language and compiler.

Related

7799 questions
79
votes
17 answers

How to add a timeout value when using Java's Runtime.exec()?

I have a method I am using to execute a command on the local host. I'd like to add a timeout parameter to the method so that if the command being called doesn't finish in a reasonable amount of time the method will return with an error code. …
James Adams
  • 8,448
  • 21
  • 89
  • 148
78
votes
9 answers

Python: dynamically create function at runtime

How to dynamically create a function in Python? I saw a few answers here but I couldn't find one which would describe the most general case. Consider: def a(x): return x + 1 How to create such function on-the-fly? Do I have to compile('...',…
Ecir Hana
  • 10,864
  • 13
  • 67
  • 117
77
votes
8 answers

What is run time environment?

Can some one explain what it means in simple terms. Does it mean the environment (DOS, Windows, Linux, etc) where the application codes are run?
rockbala
  • 2,323
  • 5
  • 20
  • 16
77
votes
5 answers

How to load a jar file at runtime

I was asked to build a java system that will have the ability to load new code (expansions) while running. How do I re-load a jar file while my code is running? or how do I load a new jar? Obviously, since constant up-time is important, I'd like to…
Amir Arad
  • 6,724
  • 9
  • 42
  • 49
74
votes
7 answers

Adding files to java classpath at runtime

Is it possible to add a file (not necessarily a jar file) to java classpath at runtime. Specifically, the file already is present in the classpath, what I want is whether I can add a modified copy of this file to the classpath. Thanks,
rdsr
72
votes
8 answers

Changing Django settings at runtime

I'd like to expose some (app-specific) settings to the admin interface, so users can change them comfortably and also not have to restart Django. How should I go about this? I checked out the applications on…
Danny W. Adair
  • 12,498
  • 4
  • 43
  • 49
72
votes
2 answers

When does a constexpr function get evaluated at compile time?

Since it is possible that a function declared as constexpr can be called during run-time, under which criteria does the compiler decide whether to compute it at compile-time or during runtime? template constexpr…
Byzantian
  • 3,208
  • 4
  • 27
  • 31
66
votes
5 answers

How can I get the memory that my Java program uses via Java's Runtime api?

There are similar questions out there, but they seem to avoid answering this specific question. How can I get the memory that my Java program uses via Java's Runtime api? The answer here indicates that I can do something like…
Matt
  • 5,408
  • 14
  • 52
  • 79
64
votes
7 answers

Setting JVM heap size at runtime

Is there a way to set heap size from a running Java program?
feiroox
  • 3,069
  • 8
  • 31
  • 31
64
votes
4 answers

What is the GOMAXPROCS default value?

Is it guaranteed that GOMAXPROCS is set to 1 when the environment variable of the same name is not set? This code shows the value: package main import ( "runtime" "fmt" ) func getGOMAXPROCS() int { return runtime.GOMAXPROCS(0) } func…
mnagel
  • 6,729
  • 4
  • 31
  • 66
63
votes
2 answers

What does `__import__('pkg_resources').declare_namespace(__name__)` do?

In some __init__.py files of modules I saw such single line: __import__('pkg_resources').declare_namespace(__name__) What does it do and why people use it? Suppose it's related to dynamic importing and creating namespace at runtime.
rsk
  • 1,266
  • 1
  • 13
  • 20
62
votes
14 answers

Is it possible to create a function dynamically, during runtime in C++?

C++ is a static, compiled language, templates are resolved during compile time and so on... But is it possible to create a function during runtime, that is not described in the source code and has not been converted to machine language during…
dtech
  • 47,916
  • 17
  • 112
  • 190
61
votes
8 answers

How to use "cd" command using Java runtime?

I've created a standalone java application in which I'm trying to change the directory using the "cd" command in Ubuntu 10.04 terminal. I've used the following code. String[] command = new String[]{"cd",path}; Process child =…
Antrromet
  • 15,294
  • 10
  • 60
  • 75
61
votes
7 answers

Change a method at runtime via a hot swap mechanism

Assume we have a trivial Java program that consists of just one class: public class HelloWorld { private static void replacable(int i) { System.out.println("Today is a nice day with a number " + i); } public static void…
darioo
  • 46,442
  • 10
  • 75
  • 103
58
votes
8 answers

Capturing stdout when calling Runtime.exec

When experiencing networking problems on client machines, I'd like to be able to run a few command lines and email the results of them to myself. I've found Runtime.exec will allow me to execute arbitrary commands, but Collecting the results in a…
Allain Lalonde
  • 91,574
  • 70
  • 187
  • 238